-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
104 lines (96 loc) · 2.81 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
104 lines (96 loc) · 2.81 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
name: hogar-prod
services:
app:
build:
context: .
dockerfile: Dockerfile
target: runner
restart: always
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER:-hogar}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-hogar}
- S3_ENDPOINT=http://storage:9000
- S3_PUBLIC_ENDPOINT=${S3_PUBLIC_ENDPOINT:-http://localhost:9000}
- S3_ACCESS_KEY=${MINIO_ROOT_USER:-minioadmin}
- S3_SECRET_KEY=${MINIO_ROOT_PASSWORD}
- S3_BUCKET=hogar-uploads
- S3_REGION=us-east-1
- REDIS_URL=redis://redis:6379
- AI_PROVIDER=${AI_PROVIDER:-}
- REPLICATE_API_TOKEN=${REPLICATE_API_TOKEN:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
- LOCAL_AI_ENDPOINT=${LOCAL_AI_ENDPOINT:-}
- AUTH_SECRET=${AUTH_SECRET}
- AUTH_URL=${AUTH_URL:-https://hogar.yourdomain.com}
- NEXT_TELEMETRY_DISABLED=1
- NODE_ENV=production
depends_on:
db:
condition: service_healthy
storage:
condition: service_started
redis:
condition: service_started
command: sh -c "npx prisma migrate deploy && node server.js"
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- certbot-conf:/etc/letsencrypt:ro
- certbot-www:/var/www/certbot:ro
depends_on:
- app
restart: always
certbot:
image: certbot/certbot
volumes:
- certbot-conf:/etc/letsencrypt
- certbot-www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-hogar}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-hogar}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-hogar}"]
interval: 5s
timeout: 5s
retries: 5
restart: always
storage:
image: minio/minio:latest
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
restart: always
createbucket:
image: minio/mc:latest
depends_on:
- storage
entrypoint: >
/bin/sh -c "
sleep 3;
mc alias set local http://storage:9000 $${MINIO_ROOT_USER:-minioadmin} $${MINIO_ROOT_PASSWORD};
mc mb --ignore-existing local/hogar-uploads;
mc anonymous set download local/hogar-uploads;
exit 0;
"
redis:
image: redis:7-alpine
restart: always
volumes:
pgdata:
minio_data:
certbot-conf:
certbot-www: