version: '3.8'

services:
  db:
    image: postgres:13
    environment:
      POSTGRES_DB: {{ db_name }}
      POSTGRES_USER: {{ db_user }}
      POSTGRES_PASSWORD: {{ db_password }}
    volumes:
      - postgres_data:/var/lib/postgresql/data

  web:
    build:
      context: .
    command: python manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    env_file:
      - .env.dev
    depends_on:
      - db

volumes:
  postgres_data:
