91 lines
2.6 KiB
YAML
91 lines
2.6 KiB
YAML
services:
|
||
mongo:
|
||
image: mongo:7.0
|
||
container_name: stoeberhunde-mongo
|
||
restart: unless-stopped
|
||
environment:
|
||
- MONGO_INITDB_ROOT_USERNAME=stoeberhunde
|
||
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
|
||
- MONGO_INITDB_DATABASE=stoeberhunde
|
||
volumes:
|
||
- mongo-data:/data/db
|
||
healthcheck:
|
||
test: ["CMD", "mongosh", "--username", "stoeberhunde", "--password", "${MONGO_PASSWORD}", "--authenticationDatabase", "admin", "--eval", "db.adminCommand('ping')"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
|
||
backend:
|
||
build: ./backend
|
||
container_name: stoeberhunde-backend
|
||
restart: unless-stopped
|
||
# Port 5012 bound to localhost only – NOT accessible from external IPs.
|
||
# Portal nginx reaches the backend via the shared jagd-network (container name).
|
||
ports:
|
||
- "127.0.0.1:5012:5000"
|
||
networks:
|
||
- default
|
||
- jagd-network
|
||
volumes:
|
||
- geocode-cache:/app/geocode-cache.json
|
||
environment:
|
||
- NODE_ENV=production
|
||
- MONGO_URI=mongodb://stoeberhunde:${MONGO_PASSWORD}@mongo:27017/stoeberhunde?authSource=admin
|
||
- JWT_SECRET=${STOEBERHUNDE_JWT_SECRET}
|
||
- JWT_EXPIRES_IN=24h
|
||
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost:8082}
|
||
- ADMIN_THORSTEN_PASSWORD=${ADMIN_THORSTEN_PASSWORD}
|
||
- GEOCODE_URL=https://nominatim.openstreetmap.org/search
|
||
- GEOCODE_USER_AGENT=stoeberhunde-app/1.0 (t.meyer@jaegerschaft-fallingbostel.de)
|
||
- GEOCODE_MIN_DELAY_MS=1100
|
||
# E-Mail / Passwort-Reset (optional)
|
||
# - SMTP_HOST=mail.example.com
|
||
# - SMTP_PORT=587
|
||
# - SMTP_USER=user@example.com
|
||
# - SMTP_PASS=${SMTP_PASS}
|
||
# - SMTP_FROM=stoeberhunde@example.com
|
||
# - APP_URL=https://example.com/stoeberhunde
|
||
depends_on:
|
||
mongo:
|
||
condition: service_healthy
|
||
healthcheck:
|
||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:5000/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
|
||
frontend:
|
||
build:
|
||
context: ./frontend
|
||
args:
|
||
- PUBLIC_URL=/stoeberhunde/
|
||
- REACT_APP_API_URL=${REACT_APP_API_URL:-}
|
||
container_name: stoeberhunde-frontend
|
||
restart: unless-stopped
|
||
ports:
|
||
- "127.0.0.1:8082:80"
|
||
networks:
|
||
- default
|
||
- jagd-network
|
||
depends_on:
|
||
- backend
|
||
healthcheck:
|
||
test: ["CMD", "wget", "-q", "--spider", "http://localhost/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
|
||
volumes:
|
||
mongo-data:
|
||
name: stoeberhunde-mongo-data
|
||
geocode-cache:
|
||
name: stoeberhunde-geocode-cache
|
||
|
||
networks:
|
||
default: {}
|
||
jagd-network:
|
||
external: true
|
||
name: jagd-network
|