mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
- Add comprehensive self-hosting guide (docs/self-hosting.md) - Add SESSION_SECRET, ALLOWED_ORIGINS, and SMTP env vars to docker-compose.yml - Document frontend pre-build requirement in Dockerfile
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: finance-manager
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${APP_PORT:-3847}:3847"
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3847
|
|
# REQUIRED: Set a strong random secret for session encryption
|
|
# Generate with: openssl rand -hex 32
|
|
SESSION_SECRET: ${SESSION_SECRET}
|
|
# Comma-separated list of allowed CORS origins (include https:// prefix in production)
|
|
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3847}
|
|
# Optional SMTP settings for email notifications
|
|
SMTP_HOST: ${SMTP_HOST:-}
|
|
SMTP_PORT: ${SMTP_PORT:-587}
|
|
SMTP_USER: ${SMTP_USER:-}
|
|
SMTP_PASS: ${SMTP_PASS:-}
|
|
SMTP_FROM: ${SMTP_FROM:-noreply@localhost}
|
|
volumes:
|
|
# Persist SQLite database across container restarts
|
|
- fm-db-data:/app/db
|
|
# Persist uploaded files
|
|
- fm-assets-data:/app/assets
|
|
develop:
|
|
watch:
|
|
- action: rebuild
|
|
path: package.json
|
|
- action: rebuild
|
|
path: backend/
|
|
- action: sync+restart
|
|
path: frontend/
|
|
target: /app/frontend
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3847/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- fm-network
|
|
|
|
volumes:
|
|
# Named volume for SQLite database persistence
|
|
fm-db-data:
|
|
driver: local
|
|
# Named volume for uploaded assets persistence
|
|
fm-assets-data:
|
|
driver: local
|
|
|
|
networks:
|
|
fm-network:
|
|
driver: bridge
|