-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (141 loc) · 2.86 KB
/
docker-compose.yml
File metadata and controls
141 lines (141 loc) · 2.86 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
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
---
volumes:
mysql:
services:
migrate:
build:
context: .
target: django
command: ["python", "manage.py", "migrate"]
working_dir: /app
restart: on-failure
cpus: 0.25
env_file:
- '.env'
depends_on:
db:
condition: service_healthy
volumes:
- type: bind
source: ./
target: /app
collectstatic:
build:
context: .
target: django
command: ["python", "manage.py", "collectstatic", "--noinput"]
working_dir: /app
restart: on-failure
cpus: 0.25
env_file:
- '.env'
depends_on:
db:
condition: service_healthy
volumes:
- type: bind
source: ./
target: /app
app:
build:
context: .
target: app
env_file:
- '.env'
depends_on:
- collectstatic
- migrate
ports:
- "8000:8000"
command: ["gunicorn", "hashtagsv2.wsgi:application"]
working_dir: /app
restart: unless-stopped
cpus: 0.5
mem_limit: 1G
volumes:
- type: bind
source: ./
target: /app
crons:
build:
context: .
target: cron
env_file:
- ".env"
depends_on:
- db
command: ["/app/crons/cron.sh"]
volumes:
- type: bind
source: ./
target: /app
- type: bind
source: ${HOST_BACKUP_DIR}
target: /app/backup
deploy:
resources:
reservations:
cpus: "0.25"
memory: "384M"
scripts:
build:
context: .
target: scripts
command: ["python", "collect_hashtags.py"]
restart: unless-stopped
cpus: 0.25
mem_limit: 64M
env_file:
- '.env'
cap_add:
- SYS_PTRACE
depends_on:
- migrate
volumes:
- type: bind
source: ./scripts
target: /scripts
- type: bind
source: ./wait_for_db.py
target: /scripts/wait_for_db.py
db:
image: quay.io/wikipedialibrary/mariadb:10-updated
env_file:
- '.env'
restart: unless-stopped
cpus: 1
mem_limit: 2G
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
volumes:
- type: volume
source: mysql
target: /var/lib/mysql
volume: {}
- type: bind
source: ./db.cnf
target: /etc/mysql/conf.d/db.cnf
nginx:
image: quay.io/wikipedialibrary/nginx:latest-updated
restart: unless-stopped
mem_limit: 32M
volumes:
- type: volume
target: /var/lib/nginx/cache
- type: bind
source: ./nginx.conf
target: /etc/nginx/conf.d/default.conf
- type: bind
source: ./robots.txt
target: /app/robots.txt
- type: bind
source: ./static
target: /app/static
ports:
- "80:80"
depends_on:
- app