---
services:
  app:
    build:
      dockerfile: docker/dev/app/Dockerfile
    volumes:
      - ./.env.dev:/srv/app/.env
      - ./assets:/srv/app/assets
      - ./src:/srv/app/src
      - ./migrations:/srv/app/migrations
      - ./Cargo.lock:/srv/app/Cargo.lock
      - ./Cargo.toml:/srv/app/Cargo.toml
      - ./diesel.toml:/srv/app/diesel.toml
      - ./Dioxus.toml:/srv/app/Dioxus.toml
      - ./tailwind.css:/srv/app/tailwind.css
    restart: always
    ports: ["8000:8000"]
    depends_on: ["db"]

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

volumes:
  db_data:
