I have the following docker-compose.yml
file:
version: '2'
services:
web:
image: myspringapp:1
ports:
- "8080:8080"
depends_on:
- myspringapp_postgres
myspringapp_postgres:
image: postgres:9.4
ports:
- "5432:5432"
volumes:
- ./pgdata:/var/lib/postgresql/data
volumes:
pgdata: {}
myspringapp is a docker image I build previously. The problem with this is that the data is lost after doing a docker-compose stop
. Anyone know what the problem is?