version: '3.10' services: db: image: postgres:15 volumes: - postgres_data:/var/lib/postgresql/data environment: POSTGRES_DB: mydatabase POSTGRES_USER: myuser POSTGRES_PASSWORD: mypassword web: build: . command: ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"] volumes: - .:/app ports: - "8000:8000" depends_on: - db volumes: postgres_data: