How to persist data in a dockerized DynamoDB using volumes

后端 未结 3 775
南旧
南旧 2021-02-02 14:36

My docker compose file has two containers and looks like this

  version: \'3\'

  services:
     dynamodb:
       image: amazon/dynamodb-local
       ports: 
            


        
3条回答
  •  你的背包
    2021-02-02 15:18

    You can try this docker-compose config:

    version: '3'
    
    volumes: 
      dynamodb_data:
    
    services:
      dynamodb:
        image: amazon/dynamodb-local
        command: -jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal
        volumes:
         - dynamodb_data:/home/dynamodblocal
        ports:
         - "8000:8000"
    

提交回复
热议问题