-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
104 lines (94 loc) · 2.71 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
104 lines (94 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# =================================================
# Docker Compose for Production Server
# =================================================
# This file goes on your SERVER - no source code needed!
#
# Recommended structure on server:
# /opt/
# ├── open-api-facturacion-sri/ ← Deploy folder
# │ ├── docker-compose.prod.yml
# │ └── .env.docker
# └── data/ ← Data folder (OUTSIDE deploy)
# ├── templates/
# ├── pdfs/
# ├── certs/
# └── xmls/
#
# Usage:
# docker compose -f docker-compose.prod.yml up -d
services:
# ─── Redis (BullMQ + Cache) ───
redis:
image: redis:7-alpine
container_name: carbone-redis
restart: unless-stopped
command: >
redis-server
--requirepass ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
--maxmemory 512mb
--maxmemory-policy allkeys-lru
--appendonly yes
--save 60 1000
volumes:
- redis_data:/data
# No exponer puertos al host en producción — solo acceso interno
healthcheck:
test: ['CMD', 'redis-cli', '-a', '${REDIS_PASSWORD:?REDIS_PASSWORD is required}', 'ping']
interval: 10s
timeout: 5s
retries: 5
logging:
driver: 'json-file'
options:
max-size: '5m'
max-file: '3'
# ─── Open API Facturación SRI ───
open-api-facturacion-sri:
# Pull from Docker Hub
image: ${DOCKER_IMAGE:-angelobarzola/open-api-facturacion-sri:latest}
container_name: open-api-facturacion-sri
restart: unless-stopped
# Load environment variables from file
env_file:
- .env.docker
environment:
# Override Redis to use compose service name
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:?REDIS_PASSWORD is required}
# Port mapping (change left port if needed)
ports:
- '${PORT:-3001}:3001'
# Data volumes - persistent storage
volumes:
- ${HOST_TEMPLATES_PATH:-../data/templates}:/data/templates
- ${HOST_PDFS_PATH:-../data/pdfs}:/data/pdfs
- ${HOST_CERTS_PATH:-../data/certs}:/data/certs
- ${HOST_XMLS_PATH:-../data/xmls}:/data/xmls
depends_on:
redis:
condition: service_healthy
# Health check
healthcheck:
test:
[
'CMD',
'wget',
'--no-verbose',
'--tries=1',
'--spider',
'http://localhost:3001/status',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Logging configuration
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '5'
volumes:
redis_data:
driver: local