-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
85 lines (82 loc) · 1.85 KB
/
docker-compose.prod.yml
File metadata and controls
85 lines (82 loc) · 1.85 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
services:
# Backend Service (Production)
backend:
build:
context: ./server
dockerfile: Dockerfile
container_name: flake-wire-backend-prod
restart: always
environment:
- NODE_ENV=production
- PORT=3001
env_file:
- .env
ports:
- "3001:3001"
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- flake-wire-network
volumes:
- ./logs:/app/logs
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /tmp
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
# Frontend Service (Production)
frontend:
build:
context: ./client
dockerfile: Dockerfile
container_name: flake-wire-frontend-prod
restart: always
environment:
- REACT_APP_API_URL=http://localhost:3001/api
ports:
- "80:80"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- flake-wire-network
security_opt:
- no-new-privileges:true
read_only: true
tmpfs:
- /var/cache/nginx
- /var/run
- /tmp
deploy:
resources:
limits:
cpus: '0.5'
memory: 128M
reservations:
cpus: '0.25'
memory: 64M
networks:
flake-wire-network:
driver: bridge
name: flake-wire-prod-network
volumes:
logs:
driver: local