title: Persist (local) dynamoDB data in volumes lack permission - unable to open database file
body: <p>I am trying to persist the data that is stored in my local dynamodb instance. I want to containerize the whole application in separate containers.</p>
  <p>This is my docker-compose.yml:</p>
  <pre><code>version: '3.8'
  
  services:
    dynamodb:
      image: amazon/dynamodb-local:latest
      command: -jar DynamoDBLocal.jar -sharedDb -dbPath /var/lib/dynamodb/data
      volumes:
          - dynamodb_data:/var/lib/dynamodb/data
      ports:
          - &quot;8000:8000&quot;
  
  &quot;translation-api&quot;:
      build: &quot;./application&quot;
      ports:
      - 5000:5000
      volumes:
      - ./application:/app
      depends_on: 
          - dynamodb
      environment:
          AWS_ACCESS_KEY_ID: 'DUMMYIDEXAMPLE'
          AWS_SECRET_ACCESS_KEY: 'DUMMYEXAMPLEKEY'
  
  volumes:
    dynamodb_data:
  </code></pre>
  <p>It works great on one of my machines (windows), but when I git clone my project to two of my other computers (one Ubuntu one Windows) I get the following error code:</p>
  <pre><code>dynamodb_1         | May 14, 2021 10:39:52 AM com.almworks.sqlite4java.Internal log
  dynamodb_1         | WARNING: [sqlite] SQLiteQueue[shared-local-instance.db]: stopped abnormally, reincarnating in 3000ms
  dynamodb_1         | May 14, 2021 10:39:55 AM com.almworks.sqlite4java.Internal log
  dynamodb_1         | WARNING: [sqlite] cannot open DB[40]: com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
  dynamodb_1         | May 14, 2021 10:39:55 AM com.almworks.sqlite4java.Internal log
  dynamodb_1         | SEVERE: [sqlite] SQLiteQueue[shared-local-instance.db]: error running job queue
  dynamodb_1         | com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1480)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:293)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteQueue.openConnection(SQLiteQueue.java:464)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteQueue.queueFunction(SQLiteQueue.java:641)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteQueue.runQueue(SQLiteQueue.java:623)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteQueue.access$000(SQLiteQueue.java:77)
  dynamodb_1         |    at com.almworks.sqlite4java.SQLiteQueue$1.run(SQLiteQueue.java:205)
  dynamodb_1         |    at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  <p>I imagine there is a problem with my docker-compose where I try to store the dynamodb volume data in &quot;/var/lib/dynamodb/data&quot; as it might lack the proper permissions to do so. If so, I am asking for assistance in how to solve the permission error. Please help out!</p>
  <p>(end goal is to persist data in my local dynamodb instance)</p>