Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (78 loc) · 1.72 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (78 loc) · 1.72 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
# Docker Compose for Production
version: '3.8'
services:
# Next.js Application
nextjs:
build:
context: .
dockerfile: Dockerfile
args:
- NODE_ENV=production
container_name: softensor-nextjs
restart: unless-stopped
environment:
- NODE_ENV=production
- PORT=3000
- HOSTNAME=0.0.0.0
env_file:
- .env.production
volumes:
- nextjs_cache:/app/.next/cache
networks:
- softensor-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
# Nginx Reverse Proxy
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: softensor-nginx
restart: unless-stopped
ports:
- "${NGINX_PORT:-80}:80"
depends_on:
nextjs:
condition: service_healthy
networks:
- softensor-network
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- nginx_cache:/var/cache/nginx
- nginx_logs:/var/log/nginx
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
networks:
softensor-network:
driver: bridge
volumes:
nextjs_cache:
driver: local
nginx_cache:
driver: local
nginx_logs:
driver: local