forked from eugene-khyst/letsencrypt-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
175 lines (166 loc) · 3.37 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: "3.9"
services:
redis:
container_name: redis
image: "redis:6-alpine"
restart: always
ports:
- "6379:6379"
volumes:
- "redisdata:/data"
command: "redis-server"
networks:
- oc_net
oc:
container_name: oc
image: opencontext/oc
restart: always
env_file:
- ./.env
environment:
- SSH_PRIVATE_KEY=${SSH_PRIVATE_KEY}
- REDIS_HOST=redis
- DEBUG="0"
- GIT_BRANCH=${GIT_BRANCH}
build:
context: .
dockerfile: oc/Dockerfile
args:
GIT_BRANCH: ${GIT_BRANCH}
stdin_open: true # docker run -i
tty: true # docker run -t
ports:
- "5432:5432"
- "8983:8983"
expose:
- 8000
links:
- redis:redis
volumes:
- $PWD:/deploy_files
- ./logs/open-context-py:/open-context-py/logs
- ./static:/open-context-py/static
- ./secrets:/oc-secrets
- oc-static:/static_root
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
command:
- run_oc
depends_on:
- redis
networks:
- oc_net
oc_worker:
container_name: oc_worker
build:
context: .
dockerfile: oc/Dockerfile
args:
GIT_BRANCH: ${GIT_BRANCH}
image: opencontext/oc
environment:
COMPOSE_PROJECT_NAME: "${COMPOSE_PROJECT_NAME}"
restart: unless-stopped
command:
- run_worker
links:
- redis:redis
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"
depends_on:
- oc
- redis
networks:
- oc_net
nginx:
container_name: nginx
build:
context: .
dockerfile: nginx/Dockerfile
image: opencontext/nginx
env_file:
- ./.env
environment:
- DOMAINS="${DOMAINS}"
- DOMAINS_WWW="${DOMAINS_WWW}"
- DEPLOY_HOST="${DEPLOY_HOST}"
- CERT_PATH="${CERT_PATH}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
volumes:
- logs_nginx:/logs/nginx
- ./static:/open-context-py/static:rw
- oc-static:/static_root
- nginx_ssl:/etc/nginx/ssl
- certbot_certs:/etc/letsencrypt
- oc_certbot:$CERT_PATH
- ./html:$NGINX_HTML_PATH
ports:
- "8000:8000"
- "80:80"
- "443:443"
restart: always
networks:
- oc_net
certbot:
build: ./certbot
image: opencontext/certbot
env_file:
- ./.env
volumes:
- certbot_certs:/etc/letsencrypt
- oc_certbot:$CERT_PATH
depends_on:
- nginx
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"
networks:
- oc_net
cron:
container_name: cron
build: ./cron
image: opencontext/cron
environment:
COMPOSE_PROJECT_NAME: "${COMPOSE_PROJECT_NAME}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./:/workdir:ro
restart: unless-stopped
depends_on:
- nginx
- certbot
logging:
driver: "json-file"
options:
max-size: "1k"
max-file: "3"
networks:
- oc_net
networks:
oc_net:
driver: bridge
name: oc_net
volumes:
logs_nginx:
external: true
nginx_ssl:
external: true
certbot_certs:
external: true
oc_certbot:
external: true
redisdata:
external: true
oc-static: