normogen/backend/docker-compose.yml
goose 147d722570
Some checks failed
Lint and Build / format (push) Successful in 35s
Lint and Build / clippy (push) Successful in 1m40s
Lint and Build / build (push) Successful in 3m45s
Lint and Build / test (push) Failing after 1s
fix: healthcheck uses HTTPS + -k for self-signed cert
2026-07-14 13:00:30 -03:00

67 lines
1.7 KiB
YAML

services:
mongodb:
image: mongo:7
container_name: normogen-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: normogen
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
backend:
build: .
container_name: normogen-backend
restart: unless-stopped
ports:
- "6500:6500"
environment:
# The app reads NORMOGEN_* / MONGODB_* / APP_ENVIRONMENT (config/mod.rs).
- APP_ENVIRONMENT=production
- NORMOGEN_HOST=0.0.0.0
- NORMOGEN_PORT=6500
- MONGODB_URI=mongodb://mongodb:27017
- MONGODB_DATABASE=normogen
# Set real, strong values in your prod .env; production boot refuses insecure defaults.
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET must be set}
- ENCRYPTION_KEY=${ENCRYPTION_KEY:?ENCRYPTION_KEY must be set}
- RUST_LOG=info
depends_on:
mongodb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:6500/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
frontend:
build:
context: ..
dockerfile: web/normogen-web/Dockerfile
container_name: normogen-frontend
restart: unless-stopped
ports:
- "6501:6501"
environment:
- BACKEND_URL=http://backend:6500
- FRONTEND_PORT=6501
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-skf", "https://localhost:6501/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
volumes:
mongodb_data: