-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
81 lines (77 loc) · 2.19 KB
/
docker-compose.prod.yml
File metadata and controls
81 lines (77 loc) · 2.19 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
# Docker Compose para Produção - Metodologia KISS
networks:
lucy-prod-network:
driver: bridge
services:
postgres:
image: postgres:15-alpine
container_name: lucy-postgres-prod
restart: always
command: ["postgres", "-c", "listen_addresses=*"] # REMOVIDAS AS ASPAS SIMPLES
environment:
POSTGRES_DB: ${POSTGRES_DB:-lucydb}
POSTGRES_USER: ${POSTGRES_USER:-lucy}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
ports:
- "5432:5432"
volumes:
- postgres_prod_data:/var/lib/postgresql/data
- ./docker/postgres/init:/docker-entrypoint-initdb.d
networks:
- lucy-prod-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lucy} -d ${POSTGRES_DB:-lucydb}"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
bot:
build:
context: .
target: production
image: lucy-bot:latest
container_name: lucy-bot-prod
restart: always
depends_on:
postgres:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-lucy}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-lucydb} # CORRIGIDO: postgres em vez de homelab.op
- DATABASE_DIRECT_URL=postgresql://${POSTGRES_USER:-lucy}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-lucydb} # CORRIGIDO
- NODE_ENV=production
- ENABLE_ADMIN_PANEL=${ENABLE_ADMIN_PANEL:-true}
- API_PORT=3050
- DISCORD_TOKEN=${DISCORD_TOKEN}
- PREFIX=${PREFIX:-l~}
ports:
- "3050:3050"
volumes:
- ./logs:/app/logs:rw
- /etc/localtime:/etc/localtime:ro
networks:
- lucy-prod-network # ADICIONADO
healthcheck:
test: ["CMD", "node", "-e", "process.exit(0)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
postgres_prod_data:
driver: local