version: '2'
services:
  db:
    image: postgres
    env_file: handoverservice.env
  web:
    build: .
    image: dukegcb/dukedshandoverservice
    env_file: handoverservice.env
    ports:
      - "8000:8000"
    depends_on:
      - db
    entrypoint:
      - /usr/src/app/handoverservice/wait-for-postgres.sh
      - db
    # docker-compose doesn't allow specifying the entrypoint while preserving
    # the Dockerfile's command
    command: python manage.py runserver 0.0.0.0:8000

version: '2'
services:
  db:
    image: postgres
    env_file: handoverservice.env
    volumes:
      - /var/lib/postgresql/data:/var/lib/postgresql/data
  web:
    build: .
    image: dukegcb/dukedshandoverservice
    env_file: handoverservice.env
    ports:
      - "8000:8000"
    depends_on:
      - db
    entrypoint:
      - /usr/src/app/handoverservice/wait-for-postgres.sh
      - db
    # docker-compose doesn't allow specifying the entrypoint while preserving
    # the Dockerfile's command
    command: python manage.py runserver 0.0.0.0:8000

Use /var/lib/postgresql/data as a host volume to persist data between containers
Use /var/lib/postgresql/data as a host volume to persist data between containers
