Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
100 lines (92 loc) · 3.06 KB
/
Copy pathcompose.yaml
File metadata and controls
100 lines (92 loc) · 3.06 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: offlineshelf
x-backend-env: &backend-env
OFFLINESHELF_ENV: ${OFFLINESHELF_ENV:-dev}
OFFLINESHELF_SECRET_KEY: ${OFFLINESHELF_SECRET_KEY:?set OFFLINESHELF_SECRET_KEY in .env}
OFFLINESHELF_DATABASE_URL: mariadb+pymysql://offlineshelf:${MARIADB_PASSWORD:?}@mariadb:3306/offlineshelf
OFFLINESHELF_REDIS_URL: redis://redis:6379/0
OFFLINESHELF_SITE_URL: ${OFFLINESHELF_SITE_URL:-http://localhost:8080}
OFFLINESHELF_TRUSTED_PROXIES: "1"
OFFLINESHELF_SMTP_HOST: ${OFFLINESHELF_SMTP_HOST:-}
OFFLINESHELF_SMTP_PORT: ${OFFLINESHELF_SMTP_PORT:-587}
OFFLINESHELF_SMTP_USERNAME: ${OFFLINESHELF_SMTP_USERNAME:-}
OFFLINESHELF_SMTP_PASSWORD: ${OFFLINESHELF_SMTP_PASSWORD:-}
OFFLINESHELF_MAIL_FROM: ${OFFLINESHELF_MAIL_FROM:-OfflineShelf <noreply@ahmershah.dev>}
services:
mariadb:
image: mariadb:11.4
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD:?}
MARIADB_DATABASE: offlineshelf
MARIADB_USER: offlineshelf
MARIADB_PASSWORD: ${MARIADB_PASSWORD:?}
volumes:
- mariadb-data:/var/lib/mysql
- ./deploy/mariadb/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./deploy/mariadb/offlineshelf.cnf:/etc/mysql/conf.d/offlineshelf.cnf:ro
ports: ["127.0.0.1:3306:3306"]
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 5s
retries: 20
redis:
image: redis:8.10-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes", "--maxmemory-policy", "noeviction"]
volumes: [redis-data:/data]
ports: ["127.0.0.1:6379:6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
api:
build: ./backend
restart: unless-stopped
environment: *backend-env
command: ["sh", "-c", "alembic upgrade head && exec gunicorn -c gunicorn.conf.py app.wsgi:app"]
volumes: [exports-data:/data/exports]
depends_on:
mariadb: {condition: service_healthy}
redis: {condition: service_healthy}
read_only: true
tmpfs: [/tmp]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
worker:
build: ./backend
restart: unless-stopped
environment: *backend-env
command: ["python", "-m", "app.worker"]
volumes: [exports-data:/data/exports]
depends_on:
api: {condition: service_started}
read_only: true
tmpfs: [/tmp]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
scheduler:
build: ./backend
restart: unless-stopped
environment: *backend-env
command: ["python", "-m", "app.scheduler"]
depends_on:
worker: {condition: service_started}
read_only: true
tmpfs: [/tmp]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
web:
build: ./frontend
restart: unless-stopped
ports: ["127.0.0.1:8080:8080"]
depends_on: [api]
read_only: true
tmpfs: [/tmp, /var/cache/nginx, /var/run]
security_opt: ["no-new-privileges:true"]
cap_drop: [ALL]
volumes:
mariadb-data:
redis-data:
exports-data: