forked from StanGirard/seo-audits-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
219 lines (211 loc) · 5.48 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
version: "3.8"
services:
server:
image: stangirard/osat-server
build:
context: ./server
dockerfile: Dockerfile
args:
TINI_VERSION: ${TINI_VERSION}
environment:
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
DATABASE_ENGINE: ${DATABASE_ENGINE}
DATABASE_HOST: postgres
DATABASE_PORT: ${POSTGRES_PORT}
DATABASE_NAME: ${POSTGRES_DB}
DATABASE_USER: ${POSTGRES_USER}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
DEBUG: ${DEBUG}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
REST_FRAMEWORK_PAGE_SIZE: ${REST_FRAMEWORK_PAGE_SIZE}
volumes:
- server-data:/opt/app/data
- server-logs:/opt/app/logs
container_name: ${NAMESPACE}-server
ports:
- "8000:8000"
command: ["django"]
depends_on:
- worker
- beats
- postgres
- dashboard
labels:
- "org.label-schema.group=webservice"
- "traefik.enable=true"
networks:
- internal
- web
restart: unless-stopped
worker:
image: stangirard/osat-server
build:
context: ./server
dockerfile: Dockerfile
args:
TINI_VERSION: ${TINI_VERSION}
environment:
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
DATABASE_ENGINE: ${DATABASE_ENGINE}
DATABASE_HOST: postgres
DATABASE_PORT: ${POSTGRES_PORT}
DATABASE_NAME: ${POSTGRES_DB}
DATABASE_USER: ${POSTGRES_USER}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
DEBUG: ${DEBUG}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
REST_FRAMEWORK_PAGE_SIZE: ${REST_FRAMEWORK_PAGE_SIZE}
volumes:
- server-data:/opt/app/data
- server-logs:/opt/app/logs
container_name: ${NAMESPACE}-worker
depends_on:
- redis
labels:
- "org.label-schema.group=queue"
- "traefik.enable=false"
networks:
- internal
command: ["worker"]
restart: unless-stopped
beats:
image: stangirard/osat-server
build:
context: ./server
dockerfile: Dockerfile
args:
TINI_VERSION: ${TINI_VERSION}
environment:
CELERY_BROKER_URL: ${CELERY_BROKER_URL}
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND}
DATABASE_ENGINE: ${DATABASE_ENGINE}
DATABASE_HOST: postgres
DATABASE_PORT: ${POSTGRES_PORT}
DATABASE_NAME: ${POSTGRES_DB}
DATABASE_USER: ${POSTGRES_USER}
DATABASE_PASSWORD: ${POSTGRES_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
DEBUG: ${DEBUG}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS}
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
REST_FRAMEWORK_PAGE_SIZE: ${REST_FRAMEWORK_PAGE_SIZE}
volumes:
- server-data:/opt/app/data
- server-logs:/opt/app/logs
container_name: ${NAMESPACE}-beats
depends_on:
- redis
labels:
- "org.label-schema.group=queue"
- "traefik.enable=false"
networks:
- internal
command: ["beat"]
restart: unless-stopped
dashboard:
image: stangirard/osat-dashboard
# image: osat/osat-dashboard:latest
container_name: ${NAMESPACE}-dashboard
build:
context: ./admin
dockerfile: Dockerfile
# dockerfile: Dockerfile
args:
NODE_VERSION: ${NODE_VERSION}
TINI_VERSION: ${TINI_VERSION}
CADDY_VERSION: "v2.3.0-rc.1" # v2.3.0-rc.1
CADDY_PLUGINS: "cors,realip,expires,cache"
volumes:
- ./admin/Caddyfile:/etc/Caddyfile:rw
# - ./dashboard/dist:/opt/osat/www
expose:
- 80
ports:
- 3000:80
networks:
- web
labels:
- "org.label-schema.group=front"
- "traefik.enable=true"
command: ["run", "--config=/etc/Caddyfile", "--watch"]
restart: unless-stopped
postgres:
image: postgres:13-alpine
container_name: ${NAMESPACE}-postgres
# ports:
# - "${POSTGRES_PORT}:${POSTGRES_PORT}"
# expose:
# - ${POSTGRES_PORT}
networks:
- internal
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data/
labels:
- "org.label-schema.group=storage"
- "traefik.enable=false"
restart: unless-stopped
redis:
# image: osat/redis:${REDIS_VERSION}-alpine
build:
context: ./.docker/alpine/redis
dockerfile: Dockerfile
args:
REDIS_VERSION: ${REDIS_VERSION}
REDIS_LOG_PREFIX_PATH: ${REDIS_LOG_PREFIX_PATH}
container_name: ${NAMESPACE}-redis
hostname: redis
networks:
- internal
volumes:
- redis-data:/data
- redis-logs:${REDIS_LOG_PREFIX_PATH}
labels:
- "org.label-schema.group=storage"
- "traefik.enable=false"
command:
- "redis-server"
- "--maxmemory ${REDIS_MEMORY_MAX}"
- "--maxmemory-policy allkeys-lru"
- "--logfile ${REDIS_LOG_FILE}"
restart: unless-stopped
networks:
internal:
driver: bridge
web:
external: true
volumes:
# server data
server-data:
server-logs:
driver_opts:
type: none
o: bind
device: ${PWD}/shared/logs/server
# Letsencrypt certificates
certs-data:
# PostreSQL
postgres-data:
# Redis
mysql-data:
mysql-logs:
driver_opts:
type: none
o: bind
device: ${PWD}/shared/logs/mysql
redis-data:
redis-logs:
driver_opts:
type: none
o: bind
device: ${PWD}/shared/logs/redis