-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
119 lines (114 loc) · 2.72 KB
/
docker-compose.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
services:
pdl-db:
container_name: pdl-db
build: db
init: true
ports:
- 27018:27017
volumes:
- ./db/data/db:/data/db
environment:
MONGO_INITDB_DATABASE: library
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD:
MONGO_INITDB_USER_USERNAME: app-admin
MONGO_INITDB_USER_PASSWORD:
logging:
options:
max-file: '5'
max-size: '5m'
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
deploy:
resources:
limits:
cpus: '0.5'
memory: '4000M'
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- library
pdl-server:
container_name: pdl-server
build: server
init: true
volumes:
- ./server/app.js:/app/app.js
- ./server/config:/app/config
- ./server/locales:/app/locales
- ./server/modules:/app/modules
- ./server/public:/app/public
- ./server/views:/app/views
- ./server/package.json:/app/package.json
# - ./server/node_modules/apostrophe:/app/node_modules/apostrophe
ports:
- 3000:3000
depends_on:
- pdl-db
environment:
APOS_DEV:
NODE_ENV: ${NODE_ENV:-production}
APOS_MONGODB_URI:
PORT:
APOS_BASE_URL:
APOS_CLUSTER_PROCESSES: 2
WAIT_HOSTS: pdl-db:27017
logging:
options:
max-file: '5'
max-size: '5m'
healthcheck:
test: node healthcheck
deploy:
resources:
limits:
cpus: '1.5'
memory: '4000M'
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- library
pdl-reverse-proxy:
container_name: pdl-reverse-proxy
image: nginx:alpine
volumes:
- ./logs:/etc/nginx/logs:rw
- ./certbot/www:/var/www/certbot/:ro
- ./certbot/conf/:/etc/letsencrypt/:ro
- ./server/public:/usr/share/nginx/backend:ro
- ./nginx/local.conf:/etc/nginx/nginx.conf:ro
- ./nginx/logs:/etc/nginx/logs:rw
depends_on:
- pdl-server
ports:
- 80:80
- 443:443
healthcheck:
test: curl -f http://localhost:90/nginx-health || exit 1
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
deploy:
resources:
limits:
cpus: '0.5'
memory: '1500M'
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- library
pdl-certbot:
image: certbot/certbot:latest
container_name: pdl-certbot
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
networks:
- library
networks:
library:
name: library