-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (100 loc) · 2.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (100 loc) · 2.33 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
105
106
version: '3.8'
services:
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
args:
- VITE_APP_URL=${VITE_APP_URL}
- VITE_WS_URL=${VITE_WS_URL}
- VITE_API_URL=${VITE_API_URL}
- NODE_IMAGE=${NODE_IMAGE}
- NGINX_IMAGE=${NGINX_IMAGE}
cache_from:
- ${NGINX_IMAGE}
- ${NODE_IMAGE}
ports:
- "80:80"
- "443:443"
depends_on:
- app
volumes:
- /etc/letsencrypt:/etc/letsencrypt:ro
networks:
- app-network
restart: unless-stopped
app:
build:
context: .
dockerfile: Dockerfile
args:
- NODE_IMAGE=${NODE_IMAGE}
cache_from:
- ${NODE_IMAGE}
env_file:
- ./server/.env
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- NODE_ENV=production
- BOT_TOKEN=${BOT_TOKEN}
- SERVICE_BOT_TOKEN=${SERVICE_BOT_TOKEN}
- APP_URL=${APP_URL}
- ADMIN_IDS=${ADMIN_IDS}
- API_BASE_URL=${API_BASE_URL}
- API_SECRET=${API_SECRET}
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
postgres:
image: ${POSTGRES_IMAGE}
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: ${REDIS_IMAGE}
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- app-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
app-network:
driver: bridge
volumes:
postgres_data:
redis_data: