-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
executable file
·177 lines (169 loc) · 4.08 KB
/
compose.yml
File metadata and controls
executable file
·177 lines (169 loc) · 4.08 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# ©AngelaMos | 2025
# Production
services:
postgres:
image: postgres:17-alpine
container_name: killprocess-db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-killprocess}
POSTGRES_USER: ${POSTGRES_USER:-killuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/src/database/migrations:/docker-entrypoint-initdb.d:ro
networks:
- backend
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-killuser} -d ${POSTGRES_DB:-killprocess}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
redis:
image: redis:7-alpine
container_name: killprocess-redis
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
networks:
- backend
deploy:
resources:
limits:
memory: 256M
cpus: '0.25'
reservations:
memory: 128M
cpus: '0.1'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
backend:
build:
context: ./backend
dockerfile: Dockerfile.prod
container_name: killprocess-backend
restart: unless-stopped
ports:
- "${BACKEND_HOST_PORT:-8096}:8000"
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-killuser}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-killprocess}
REDIS_URL: redis://redis:6379
RUST_LOG: ${RUST_LOG:-info}
PORT: 8000
ENVIRONMENT: production
GITHUB_TOKEN: ${GITHUB_TOKEN}
GITHUB_USERNAME: ${GITHUB_USERNAME}
networks:
- backend
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
deploy:
resources:
limits:
memory: 1G
cpus: '1.0'
reservations:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
args:
VITE_API_URL: ${VITE_API_URL:-/api}
container_name: killprocess-frontend
restart: unless-stopped
networks:
- frontend
depends_on:
- backend
deploy:
resources:
limits:
memory: 256M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.25'
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
nginx:
image: nginx:1.27-alpine
container_name: killprocess-nginx
restart: unless-stopped
ports:
- "${NGINX_HOST_PORT:-8095}:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/sites-enabled:/etc/nginx/sites-enabled:ro
networks:
- frontend
- backend
depends_on:
- frontend
- backend
deploy:
resources:
limits:
memory: 128M
cpus: '0.5'
reservations:
memory: 64M
cpus: '0.1'
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
cloudflared:
image: cloudflare/cloudflared:latest
container_name: killprocess-tunnel
command: tunnel run --token ${CLOUDFLARE_TUNNEL_TOKEN}
networks:
- frontend
depends_on:
nginx:
condition: service_started
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
reservations:
cpus: '0.1'
memory: 32M
restart: unless-stopped
networks:
frontend:
driver: bridge
backend:
driver: bridge
volumes:
postgres_data:
redis_data: