-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
95 lines (87 loc) · 2.66 KB
/
docker-compose.prod.yml
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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# eshop.blue - Production configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
version: "3.7"
networks:
eshop-network:
driver: bridge
services:
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
args:
- FRONTEND_PORT=${FRONTEND_PORT:-3000}
- FA_TOKEN=${FA_TOKEN}
- BACKEND_API_URL=${BACKEND_API_URL}
ports:
- 80:80
- 443:443
networks:
- eshop-network
depends_on:
- backend
volumes:
- './frontend:/app'
- '/app/node_modules' # exclude node_modules
- ./frontend/server/nginx.conf:/etc/nginx/nginx.conf
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/html
- dhparam:/etc/ssl/certs
restart: unless-stopped
backend:
container_name: backend
build:
context: ./backend
dockerfile: Dockerfile
args:
- BACKEND_PORT=${BACKEND_PORT:-4000}
command: '/bin/sh -c "pm2-runtime start ecosystem.config.js --env production"'
expose:
- ${BACKEND_PORT:-4000}
volumes:
- ./backend:/app
restart: unless-stopped
networks:
- eshop-network
mongo:
container_name: mongo
image: mongo
environment:
- ENV=production
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
- MONGODB_USER=${MONGODB_USER}
- MONGODB_PASS=${MONGODB_PASS}
volumes:
- ./data/db:/data/db
expose:
- ${MONGODB_PORT}
command: mongod --port ${MONGODB_PORT}
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- web-root:/var/www/html
depends_on:
- frontend
command: certonly --webroot --webroot-path=/var/www/html --email andrejn26@gmail.com --agree-tos --no-eff-email --force-renewal -d eshop.blue -d www.eshop.blue
volumes:
certbot-etc:
certbot-var:
web-root:
driver: local
driver_opts:
type: none
device: /home/dev/pis-eshop/web-root/
o: bind
dhparam:
driver: local
driver_opts:
type: none
device: /home/dev/pis-eshop/dhparam/
o: bind