version: "3.9"

services:
  {{ PKG.NAME }}:
    container_name: {{ PKG.NAME }}
    build:
      context: {{ PKG.NAME }}
      dockerfile: Dockerfile
    depends_on:
      db:
        condition: service_healthy
    environment:
      DATABASE_URL: "${DATABASE_URL}"
    volumes:
      - {{ PKG.NAME }}:/{{ PKG.NAME }}
    expose:
      - "8000"
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8000/healthz || exit 1"]
      interval: "30s"
      timeout: "10s"
      retries: 3

volumes:
  {{ PKG.NAME }}: