-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
76 lines (72 loc) · 2.02 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
76 lines (72 loc) · 2.02 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
# Production Docker Compose override
# =============================================================================
# Usage: docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
#
# This file adds production hardening on top of docker-compose.yml.
# Do NOT use this file directly — always combine it with the base compose file.
# =============================================================================
services:
postgres:
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rustshare -d rustshare"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
rustfs:
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
backend:
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
environment:
SERVER_HOST: 0.0.0.0
RUST_LOG: info
SESSION_COOKIE_SECURE: "true"
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1:8080/health"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
nginx:
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
ports:
- "80:80"
# Uncomment the line below to enable HTTPS on port 443:
# - "443:443"
# WARNING: When enabling TLS volumes, you MUST also include the base nginx.conf
# mount or the configuration will be lost. Full example:
# volumes:
# - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
# - ./certs/fullchain.pem:/etc/nginx/ssl/fullchain.pem:ro
# - ./certs/privkey.pem:/etc/nginx/ssl/privkey.pem:ro