-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.server.yml
More file actions
83 lines (81 loc) · 3.01 KB
/
Copy pathdocker-compose.server.yml
File metadata and controls
83 lines (81 loc) · 3.01 KB
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
services:
db:
profiles: ["local-db"]
image: ${MYSQL_IMAGE:-mysql:8.4}
command: ${MYSQL_SERVER_ARGS:---character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci}
restart: unless-stopped
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-algowiki}
MYSQL_USER: ${MYSQL_USER:-algowiki}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-change-me}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-change-root-password}
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$${MYSQL_ROOT_PASSWORD} --silent"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
web:
image: ${APP_IMAGE:-algowiki-web:local}
build:
context: .
dockerfile: Dockerfile
env_file:
- ${APP_ENV_FILE:-deploy/.env.production}
restart: unless-stopped
init: true
environment:
DJANGO_DEBUG: ${DJANGO_DEBUG:-0}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-replace-with-a-long-random-secret}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1}
DJANGO_CSRF_TRUSTED_ORIGINS: ${DJANGO_CSRF_TRUSTED_ORIGINS:-http://localhost}
ALGOWIKI_RELEASE: ${ALGOWIKI_RELEASE:-server}
DJANGO_SERVE_FRONTEND: 1
DJANGO_USE_X_FORWARDED_HOST: ${DJANGO_USE_X_FORWARDED_HOST:-0}
DJANGO_USE_X_FORWARDED_PORT: ${DJANGO_USE_X_FORWARDED_PORT:-0}
DJANGO_SECURE_PROXY_SSL_HEADER: ${DJANGO_SECURE_PROXY_SSL_HEADER:-}
SECURE_SSL_REDIRECT: ${SECURE_SSL_REDIRECT:-0}
SECURE_HSTS_SECONDS: ${SECURE_HSTS_SECONDS:-0}
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-0}
CSRF_COOKIE_SECURE: ${CSRF_COOKIE_SECURE:-0}
DB_ENGINE: mysql
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-3306}
DB_NAME: ${DB_NAME:-algowiki}
DB_USER: ${DB_USER:-algowiki}
DB_PASSWORD: ${DB_PASSWORD:-change-me}
DB_CHARSET: ${DB_CHARSET:-utf8mb4}
DB_CONN_MAX_AGE: ${DB_CONN_MAX_AGE:-300}
MEDIA_ROOT: /app/backend/media
MEDIA_URL: ${MEDIA_URL:-/media/}
FRONTEND_DIST_DIR: /app/frontend/dist
SUPERADMIN_USERNAME: ${SUPERADMIN_USERNAME:-superadmin}
SUPERADMIN_PASSWORD: ${SUPERADMIN_PASSWORD:-replace-with-a-random-password}
SUPERADMIN_EMAIL: ${SUPERADMIN_EMAIL:-admin@example.com}
GUNICORN_WORKERS: ${GUNICORN_WORKERS:-2}
GUNICORN_TIMEOUT: ${GUNICORN_TIMEOUT:-120}
DB_WAIT_TIMEOUT: ${DB_WAIT_TIMEOUT:-60}
DB_WAIT_INTERVAL: ${DB_WAIT_INTERVAL:-2}
ports:
- "${APP_BIND:-127.0.0.1}:${APP_PORT:-8001}:8001"
volumes:
- media_data:/app/backend/media
- storage_data:/app/storage
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; req=urllib.request.Request('http://127.0.0.1:8001/api/health/', headers={'X-Forwarded-Proto':'https'}); urllib.request.urlopen(req, timeout=5).read()",
]
interval: 30s
timeout: 5s
retries: 5
start_period: 40s
volumes:
mysql_data:
media_data:
storage_data: