225fb1306b
docker-compose.dev.yml gains a Kratos identity service (public :4433 / admin :4434) and a Mailpit SMTP catcher for local onboarding email codes, plus a postgres-init mount. deploy/local/kratos/ holds the local Kratos config + identity schema (placeholder dev cookie secret only). Supports the local backend the XCUITest suite seeds against. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
268 lines
7.5 KiB
YAML
268 lines
7.5 KiB
YAML
# Local development compose file (self-contained, no base file needed)
|
|
# Usage:
|
|
# docker compose -f docker-compose.dev.yml up --build
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: honeydue-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-honeydue}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-honeydue_dev_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-honeydue}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./deploy/local/postgres-init:/docker-entrypoint-initdb.d:ro
|
|
ports:
|
|
- "${DB_PORT:-5433}:5432" # 5433 externally to avoid conflicts with local postgres
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-honeydue} -d ${POSTGRES_DB:-honeydue}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# Redis Cache
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: honeydue-redis
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# honeyDue API
|
|
api:
|
|
build:
|
|
context: .
|
|
target: api
|
|
container_name: honeydue-api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PORT:-8000}:8000"
|
|
environment:
|
|
# Server
|
|
PORT: "8000"
|
|
DEBUG: "true"
|
|
DEBUG_FIXED_CODES: "true"
|
|
ALLOWED_HOSTS: "localhost,127.0.0.1"
|
|
TIMEZONE: "${TIMEZONE:-UTC}"
|
|
|
|
# Database
|
|
DB_HOST: db
|
|
DB_PORT: "5432"
|
|
POSTGRES_USER: ${POSTGRES_USER:-honeydue}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-honeydue_dev_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-honeydue}
|
|
DB_SSLMODE: "disable"
|
|
|
|
# Redis
|
|
REDIS_URL: "redis://redis:6379/0"
|
|
|
|
# Security
|
|
SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production-min-32-chars}
|
|
|
|
# Email
|
|
EMAIL_HOST: ${EMAIL_HOST:-smtp.gmail.com}
|
|
EMAIL_PORT: ${EMAIL_PORT:-587}
|
|
EMAIL_HOST_USER: ${EMAIL_HOST_USER}
|
|
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
|
|
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-honeyDue <noreply@honeyDue.treytartt.com>}
|
|
EMAIL_USE_TLS: "true"
|
|
|
|
# Push Notifications
|
|
APNS_AUTH_KEY_PATH: ${APNS_AUTH_KEY_PATH}
|
|
APNS_AUTH_KEY_ID: ${APNS_AUTH_KEY_ID}
|
|
APNS_TEAM_ID: ${APNS_TEAM_ID}
|
|
APNS_TOPIC: ${APNS_TOPIC:-com.myhoneydue.honeyDue.dev}
|
|
APNS_USE_SANDBOX: "true"
|
|
FCM_SERVER_KEY: ${FCM_SERVER_KEY}
|
|
|
|
# Storage encryption
|
|
STORAGE_ENCRYPTION_KEY: ${STORAGE_ENCRYPTION_KEY}
|
|
|
|
# Kratos (identity service)
|
|
KRATOS_PUBLIC_URL: "http://kratos:4433"
|
|
KRATOS_ADMIN_URL: "http://kratos:4434"
|
|
volumes:
|
|
- ./push_certs:/certs:ro
|
|
- ./uploads:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
kratos:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://127.0.0.1:8000/api/health/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
start_period: 10s
|
|
retries: 3
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# honeyDue Admin Panel (Next.js)
|
|
admin:
|
|
build:
|
|
context: .
|
|
target: admin
|
|
container_name: honeydue-admin
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${ADMIN_PORT:-3000}:3000"
|
|
environment:
|
|
PORT: "3000"
|
|
HOSTNAME: "0.0.0.0"
|
|
NEXT_PUBLIC_API_URL: "${NEXT_PUBLIC_API_URL:-http://api:8000}"
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3000/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# honeyDue Worker (Background Jobs)
|
|
worker:
|
|
build:
|
|
context: .
|
|
target: worker
|
|
container_name: honeydue-worker
|
|
restart: unless-stopped
|
|
environment:
|
|
# Database
|
|
DB_HOST: db
|
|
DB_PORT: "5432"
|
|
POSTGRES_USER: ${POSTGRES_USER:-honeydue}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-honeydue_dev_password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-honeydue}
|
|
DB_SSLMODE: "disable"
|
|
|
|
# Redis
|
|
REDIS_URL: "redis://redis:6379/0"
|
|
|
|
# Security
|
|
SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production-min-32-chars}
|
|
|
|
# Push Notifications
|
|
APNS_AUTH_KEY_PATH: "/certs/apns_key.p8"
|
|
APNS_AUTH_KEY_ID: ${APNS_AUTH_KEY_ID}
|
|
APNS_TEAM_ID: ${APNS_TEAM_ID}
|
|
APNS_TOPIC: ${APNS_TOPIC:-com.myhoneydue.honeyDue.dev}
|
|
APNS_USE_SANDBOX: "true"
|
|
FCM_SERVER_KEY: ${FCM_SERVER_KEY}
|
|
|
|
# Email
|
|
EMAIL_HOST: ${EMAIL_HOST:-smtp.gmail.com}
|
|
EMAIL_PORT: ${EMAIL_PORT:-587}
|
|
EMAIL_HOST_USER: ${EMAIL_HOST_USER}
|
|
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
|
|
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-honeyDue <noreply@honeyDue.treytartt.com>}
|
|
EMAIL_USE_TLS: "true"
|
|
|
|
# Worker settings (UTC hours for scheduled jobs)
|
|
TASK_REMINDER_HOUR: ${TASK_REMINDER_HOUR:-14}
|
|
OVERDUE_REMINDER_HOUR: ${OVERDUE_REMINDER_HOUR:-15}
|
|
DAILY_DIGEST_HOUR: ${DAILY_DIGEST_HOUR:-3}
|
|
volumes:
|
|
- ./push_certs:/certs:ro
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# Mailpit — local SMTP catcher (for Kratos email codes during onboarding)
|
|
mailpit:
|
|
image: axllent/mailpit:latest
|
|
container_name: honeydue-mailpit
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${MAILPIT_SMTP_PORT:-1025}:1025"
|
|
- "${MAILPIT_HTTP_PORT:-8025}:8025"
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# Kratos schema migration (one-shot, runs before kratos starts)
|
|
kratos-migrate:
|
|
image: oryd/kratos:v1.3.0
|
|
container_name: honeydue-kratos-migrate
|
|
command: ["migrate", "sql", "-e", "--yes"]
|
|
environment:
|
|
DSN: "postgres://${POSTGRES_USER:-honeydue}:${POSTGRES_PASSWORD:-honeydue_dev_password}@db:5432/kratos?sslmode=disable"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- honeydue-network
|
|
restart: "no"
|
|
|
|
# Ory Kratos — identity service
|
|
kratos:
|
|
image: oryd/kratos:v1.3.0
|
|
container_name: honeydue-kratos
|
|
restart: unless-stopped
|
|
command: ["serve", "--config", "/etc/config/kratos/kratos.yml", "--watch-courier", "--dev"]
|
|
ports:
|
|
- "${KRATOS_PUBLIC_PORT:-4433}:4433"
|
|
- "${KRATOS_ADMIN_PORT:-4434}:4434"
|
|
environment:
|
|
DSN: "postgres://${POSTGRES_USER:-honeydue}:${POSTGRES_PASSWORD:-honeydue_dev_password}@db:5432/kratos?sslmode=disable"
|
|
LOG_LEVEL: "debug"
|
|
volumes:
|
|
- ./deploy/local/kratos:/etc/config/kratos:ro
|
|
depends_on:
|
|
kratos-migrate:
|
|
condition: service_completed_successfully
|
|
mailpit:
|
|
condition: service_started
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:4434/health/ready"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 10s
|
|
networks:
|
|
- honeydue-network
|
|
|
|
# Dozzle — lightweight real-time log viewer
|
|
dozzle:
|
|
image: amir20/dozzle:latest
|
|
container_name: honeydue-dozzle
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${DOZZLE_PORT:-9999}:8080"
|
|
environment:
|
|
DOZZLE_NO_ANALYTICS: "true"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
networks:
|
|
- honeydue-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
|
|
networks:
|
|
honeydue-network:
|
|
driver: bridge
|