mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-22 06:38:21 +02:00
Prepare the application for deployment to a production environment
Adds Docker Compose configuration, Nginx setup, and deployment scripts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/1668b635-4205-40d7-8634-6b7174d94d7b.jpg
This commit is contained in:
1 parent
9b0a09614a
commit
9cc28ddc93
8 files changed
+635
No files matched your search
@@ -0,0 +1,113 @@
|
||||
version: '3.8'
|
||||
|
||||
# Configuration Docker Compose optimisée pour Production
|
||||
# Usage: docker-compose -f docker-compose.prod.yml up -d
|
||||
services:
|
||||
# Base de données PostgreSQL Production
|
||||
regisflow-db:
|
||||
image: postgres:15-alpine
|
||||
container_name: regisflow-db-prod
|
||||
environment:
|
||||
POSTGRES_DB: regisflow
|
||||
POSTGRES_USER: regisflow
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256 --auth-local=scram-sha-256"
|
||||
volumes:
|
||||
- postgres_data_prod:/var/lib/postgresql/data
|
||||
- ./postgresql.conf:/etc/postgresql/postgresql.conf:ro
|
||||
ports:
|
||||
- "5433:5432"
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 1G
|
||||
cpus: '1.0'
|
||||
reservations:
|
||||
memory: 512M
|
||||
cpus: '0.5'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U regisflow -d regisflow"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
command: postgres -c config_file=/etc/postgresql/postgresql.conf
|
||||
|
||||
# Application RegisFlow Production
|
||||
regisflow:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
||||
args:
|
||||
- NODE_ENV=production
|
||||
image: regisflow:production
|
||||
container_name: regisflow-app-prod
|
||||
depends_on:
|
||||
regisflow-db:
|
||||
condition: service_healthy
|
||||
pull_policy: never
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 5000
|
||||
DATABASE_URL: postgresql://regisflow:${POSTGRES_PASSWORD}@regisflow-db:5432/regisflow
|
||||
SESSION_SECRET: ${SESSION_SECRET}
|
||||
TZ: ${TZ:-Europe/Paris}
|
||||
SECURE_COOKIES: ${SECURE_COOKIES:-true}
|
||||
DATA_RETENTION_MONTHS: ${DATA_RETENTION_MONTHS:-19}
|
||||
BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-90}
|
||||
MAX_BACKUP_COUNT: ${MAX_BACKUP_COUNT:-20}
|
||||
NODE_OPTIONS: "--max-old-space-size=1024"
|
||||
volumes:
|
||||
- backup_data_prod:/app/backups
|
||||
- logs_data_prod:/app/logs
|
||||
ports:
|
||||
- "5000:5000"
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 1.5G
|
||||
cpus: '2.0'
|
||||
reservations:
|
||||
memory: 512M
|
||||
cpus: '0.5'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 15s
|
||||
retries: 3
|
||||
start_period: 120s
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-size: "100m"
|
||||
max-file: "5"
|
||||
|
||||
# Volumes persistants pour production
|
||||
volumes:
|
||||
postgres_data_prod:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
o: bind
|
||||
device: /opt/regisflow/data/postgres
|
||||
backup_data_prod:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
o: bind
|
||||
device: /opt/regisflow/data/backups
|
||||
logs_data_prod:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
o: bind
|
||||
device: /opt/regisflow/data/logs
|
||||
|
||||
# Réseau pour reverse proxy
|
||||
networks:
|
||||
default:
|
||||
name: regisflow-network
|
||||
driver: bridge
|
||||
Reference in new issue
Block a user