version: '3.7'

services:
  web:
    image: wger/devel:2.0-dev
    volumes:
      - type: bind
        source: ../../../
        target: /home/wger/src/
    ports:
      - 8000:8000
    env_file:
      - ./dev.env
    depends_on:
      - db
      - cache
  db:
    image: postgres:12.0-alpine
    volumes:
      - type: bind
        source: ./wger-postgres-data
        target: /var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=wger
      - POSTGRES_PASSWORD=wger
      - POSTGRES_DB=wger

  cache:
    image: memcached

volumes:
  postgres_data:

version: '3.7'

services:
  web:
    image: wger/devel:2.0-dev
    volumes:
      - type: bind
        source: ../../../
        target: /home/wger/src/
    ports:
      - 8000:8000
    env_file:
      - ./dev.env
    depends_on:
      - db
      - cache
  db:
    image: postgres:12.0-alpine
    volumes:
      - wger-postgres-data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_USER=wger
      - POSTGRES_PASSWORD=wger
      - POSTGRES_DB=wger

  cache:
    image: memcached

volumes:
  wger-postgres-data:

Use a volume to store postgres' data
Use a volume to store postgres' data
