This repository has been archived by the owner on Nov 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
/
docker-compose.prod.yml
77 lines (70 loc) · 2.47 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
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# \\\\\\\\\\\\\\\\\\\ PRODUCTION ENVIRONMENT \\\\\\\\\\\\\\\\\
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
version: '3.5'
services:
# ------------------------------------------------------------
# Nginx - Webserver
# ------------------------------------------------------------
nginx:
image: nginx:mainline-alpine
restart: unless-stopped
container_name: nginx
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
ports:
- "80:80"
- "443:443"
volumes:
- ./.docker/nginx/prod:/etc/nginx/conf.d:z
- ./.docker/certbot/conf:/etc/letsencrypt:z
- ./.docker/certbot/www:/var/www/certbot:z
# ------------------------------------------------------------
# CERTBOT - SSL CERTIFICATION
# ------------------------------------------------------------
certbot:
image: certbot/certbot
restart: unless-stopped
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
- ./.docker/certbot/conf:/etc/letsencrypt:z
- ./.docker/certbot/www:/var/www/certbot:z
# ------------------------------------------------------------
# Node - Backend
# ------------------------------------------------------------
backend:
build:
context: ./.docker/build/node
args:
NODE_VERSION: ${BACKEND_NODE_VER}-alpine
hostname: backend
working_dir: /home/node/app
volumes:
- ./server:/home/node/app:z
command:
- sh
- -c
- npm ci && npm run start:${START_BACKEND_AS}
depends_on:
- redis
- mongo
# ------------------------------------------------------------
# Redis - Cache Management
# ------------------------------------------------------------
redis:
image: redis:${REDIS_SERVER}-alpine
hostname: redis
# Apply custom arguments to redis startup
command: redis-server ${REDIS_ARGS:- }
environment:
- REDIS_ARGS=${REDIS_ARGS:- }
# ------------------------------------------------------------
# MongoDB - Database
# ------------------------------------------------------------
mongo:
image: mongo:${MONGO_SERVER}
hostname: mongo
volumes:
# Mount MongoDB Data directory
- ./.docker/data/mongo:/data/db:z