- staging/prod: postgres:16-alpine per the llmdev Docker spec (healthcheck, log and memory limits, no host port); the app builds DATABASE_URI from POSTGRES_PASSWORD and waits for a healthy database; MongoDB kept for one release (rollback path, transfer source) - dev: PostgreSQL replaces MongoDB and Mongo Express (host port 5433, checked and registered); integration test rewritten with pg - deploy.sh: pg_dump (and, during the switch, mongodump) before the build - pg/@types/pg pinned to the adapter's 8.20.0 (one copy, no type clash) - docs: CLAUDE.md, architecture/testing steering, deploy workflow, DOCKER.md; staging switch runbook in the design Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
98 lines
2.7 KiB
YAML
Executable File
98 lines
2.7 KiB
YAML
Executable File
services:
|
|
# Next.js Application
|
|
app:
|
|
build:
|
|
context: ./proto
|
|
dockerfile: Dockerfile
|
|
target: builder # Use builder stage for development
|
|
container_name: mozdit-app-dev
|
|
ports:
|
|
- "127.0.0.1:8080:3000"
|
|
environment:
|
|
- NODE_ENV=development
|
|
# MITHOME-136: PostgreSQL; dev-only, not secret credentials.
|
|
- DATABASE_URI=postgresql://mozdit_web:devpassword@postgres:5432/mozdit_web
|
|
# Dev-only, nem titkos (MITHOME-97) — Payload ez nélkül el sem indul
|
|
# ("missing secret key"), és ez a compose fájl eddig nem adta át.
|
|
- PAYLOAD_SECRET=dev-only-insecure-secret-do-not-use-in-staging-or-prod
|
|
- NEXT_PUBLIC_SITE_URL=http://localhost:8080
|
|
- NEXT_PUBLIC_COMPANY_NAME=mozdIT Bt.
|
|
- NEXT_PUBLIC_CONTACT_EMAIL=info@mozdit.hu
|
|
- NEXT_PUBLIC_WEBMAIL_URL=https://mail.mozdit.hu
|
|
volumes:
|
|
- ./proto:/app
|
|
- /app/node_modules
|
|
- /app/.next
|
|
command: npm run dev
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- mozdit-network
|
|
restart: unless-stopped
|
|
|
|
# PostgreSQL (MITHOME-136). Host port 5433 is registered in the llmdev port
|
|
# registry (5432 is peakxi-dev) — for the integration tests and local tools.
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: mozdit-postgres-dev
|
|
ports:
|
|
- "127.0.0.1:5433:5432"
|
|
environment:
|
|
- POSTGRES_DB=mozdit_web
|
|
- POSTGRES_USER=mozdit_web
|
|
- POSTGRES_PASSWORD=devpassword
|
|
volumes:
|
|
- postgres_data_dev:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U mozdit_web -d mozdit_web"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- mozdit-network
|
|
restart: unless-stopped
|
|
|
|
# Loki for Logging
|
|
loki:
|
|
image: grafana/loki:2.9.0
|
|
container_name: mozdit-loki-dev
|
|
ports:
|
|
- "127.0.0.1:3100:3100"
|
|
command: -config.file=/etc/loki/local-config.yaml
|
|
volumes:
|
|
- loki_data:/loki
|
|
networks:
|
|
- mozdit-network
|
|
restart: unless-stopped
|
|
|
|
# Grafana for Monitoring
|
|
grafana:
|
|
image: grafana/grafana:10.2.0
|
|
container_name: mozdit-grafana-dev
|
|
ports:
|
|
# MITHOME-137: 3001 is taken by "step" on llmdev (port registry)
|
|
- "127.0.0.1:3012:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./docker/grafana/provisioning:/etc/grafana/provisioning
|
|
depends_on:
|
|
- loki
|
|
networks:
|
|
- mozdit-network
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data_dev:
|
|
driver: local
|
|
loki_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
networks:
|
|
mozdit-network:
|
|
driver: bridge
|