---
services:
  app:
    build:
      dockerfile: docker/prod/app/Dockerfile
    networks:
      - default
      - web-server-network
    ports: ["8000:80"]
    restart: always
    depends_on: ["db"]

  db:
    image: postgres:16.11-alpine3.23@sha256:a5074487380d4e686036ce61ed6f2d363939ae9a0c40123d1a9e3bb3a5f344b4
    volumes: ["db_data:/var/lib/postgresql/data"]
    networks:
      - default
    environment:
      POSTGRES_DB: todo_baggins
      POSTGRES_USER: app
      POSTGRES_PASSWORD: app
    restart: always

volumes:
  db_data:

networks:
  web-server-network:
    external: true
