-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
93 lines (88 loc) · 2.49 KB
/
docker-compose.prod.yml
File metadata and controls
93 lines (88 loc) · 2.49 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
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-hashhive}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-hashhive}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-hashhive}']
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD:-changeme}
volumes:
- redisdata:/data
healthcheck:
test: ['CMD', 'redis-cli', '-a', '${REDIS_PASSWORD:-changeme}', 'ping']
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
restart: unless-stopped
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY:?Set S3_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:?Set S3_SECRET_KEY}
volumes:
- miniodata:/data
command: server /data
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/ready']
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: .
dockerfile: packages/backend/Dockerfile
restart: unless-stopped
ports:
- '${BACKEND_PORT:-4000}:4000'
environment:
NODE_ENV: production
PORT: 4000
LOG_LEVEL: ${LOG_LEVEL:-info}
LOG_PRETTY: 'false'
DATABASE_URL: postgres://${POSTGRES_USER:-hashhive}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-hashhive}
REDIS_URL: redis://:${REDIS_PASSWORD:-changeme}@redis:6379
S3_ENDPOINT: http://minio:9000
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_BUCKET: ${S3_BUCKET:-hashhive}
S3_REGION: ${S3_REGION:-us-east-1}
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET (min 16 chars)}
JWT_EXPIRY: ${JWT_EXPIRY:-24h}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
healthcheck:
test: ['CMD', 'wget', '-qO-', 'http://localhost:4000/health']
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
frontend:
build:
context: .
dockerfile: packages/frontend/Dockerfile
restart: unless-stopped
ports:
- '${FRONTEND_PORT:-80}:80'
depends_on:
backend:
condition: service_healthy
volumes:
pgdata:
redisdata:
miniodata: