-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
192 lines (181 loc) · 5.21 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
#
# Docker service definitions for the aurweb project.
#
# Notable services:
# - `sharness` - Run sharness test suites
# - `pytest-mysql` - Run pytest suites with MariaDB
# - `pytest-sqlite` - Run pytest suites with SQLite
# - `test` - Run sharness, pytest-mysql and pytest-sqlite
# - `mariadb` - `port 13306` - MariaDB server for docker
# - `git` - `port 2222` - Git over SSH server
# - `fastapi` - hypercorn service for aurweb's FastAPI app
# - `nginx` - `ports 8444 (FastAPI), 8443 (PHP)` - Everything
# - You can reach `nginx` via FastAPI at `https://localhost:8444/`
# or via PHP at `https://localhost:8443/`.
#
# Copyright (C) 2021 aurweb Development
# All Rights Reserved.
version: "3.8"
services:
aurweb-image:
build: .
image: mprweb:latest
memcached:
image: mprweb:latest
init: true
command: /docker/scripts/run-memcached.sh
healthcheck:
test: "bash /docker/health/memcached.sh"
interval: 4s
redis:
image: mprweb:latest
init: true
entrypoint: /docker/redis-entrypoint.sh
command: /docker/scripts/run-redis.sh
healthcheck:
test: "bash /docker/health/redis.sh"
interval: 4s
ports:
- "127.0.0.1:16379:6379"
volumes:
- ./docker:/docker
mariadb:
image: mprweb:latest
init: true
entrypoint: /docker/mariadb-entrypoint.sh
command: "/usr/bin/mysqld_safe --datadir=/var/lib/mysql"
ports:
# This will expose mariadbd on 127.0.0.1:13306 in the host.
# Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb`
- "127.0.0.1:13306:3306"
volumes:
- mariadb_run:/var/run/mysqld # Bind socket in this volume.
- mariadb_data:/var/lib/mysql
- ./mprweb.cfg:/mprweb.cfg
- ./aurweb:/aurweb/aurweb
- ./docker:/docker
healthcheck:
test: "bash /docker/health/mariadb.sh"
interval: 4s
mariadb_init:
image: mprweb:latest
init: true
entrypoint: /docker/mariadb-init-entrypoint.sh
volumes:
- mariadb_run:/var/run/mysqld
- ./mprweb.cfg:/mprweb.cfg
depends_on:
mariadb:
condition: service_healthy
git:
image: mprweb:latest
init: true
environment:
- SSH_CMDLINE=${SSH_CMDLINE:-ssh ssh://aur@localhost:2222}
entrypoint: /docker/git-entrypoint.sh
ports:
- "2222:2222"
healthcheck:
test: "bash /docker/health/sshd.sh"
interval: 4s
depends_on:
mariadb_init:
condition: service_started
volumes:
- ./aurweb:/aurweb/aurweb
- ./data/git_data:/aurweb/aur.git
- ./mprweb.cfg:/mprweb.cfg
- ./data:/aurweb/data
- ./docker:/docker
- mariadb_run:/var/run/mysqld
smartgit:
image: mprweb:latest
init: true
entrypoint: /docker/smartgit-entrypoint.sh
command: /docker/scripts/run-smartgit.sh
healthcheck:
test: "bash /docker/health/smartgit.sh"
interval: 4s
volumes:
- ./data/git_data:/aurweb/aur.git
- ./data:/data
- smartgit_run:/var/run/smartgit
cron:
image: mprweb:latest
init: true
entrypoint: /docker/cron-entrypoint.sh
command: /docker/scripts/run-cron.sh
depends_on:
mariadb_init:
condition: service_started
volumes:
- ./aurweb:/aurweb/aurweb
- ./docker:/docker
- ./mprweb.cfg:/mprweb.cfg
- mariadb_run:/var/run/mysqld
- archives:/var/lib/aurweb/archives
fastapi:
image: mprweb:latest
init: true
environment:
- FASTAPI_BACKEND=${FASTAPI_BACKEND}
- FASTAPI_WORKERS=${FASTAPI_WORKERS}
- AURWEB_FASTAPI_PREFIX=${AURWEB_FASTAPI_PREFIX}
- AURWEB_SSHD_PREFIX=${AURWEB_SSHD_PREFIX}
- PROMETHEUS_MULTIPROC_DIR=/tmp_prometheus
- WATCH_SASS_FILES=${WATCH_SASS_FILES:-1}
entrypoint: /docker/fastapi-entrypoint.sh
command: /docker/scripts/run-fastapi.sh "${FASTAPI_BACKEND}"
healthcheck:
test: "bash /docker/health/fastapi.sh ${FASTAPI_BACKEND}"
interval: 4s
depends_on:
git:
condition: service_healthy
redis:
condition: service_healthy
cron:
condition: service_started
volumes:
- ./mprweb.cfg:/mprweb.cfg
- ./docker:/docker
- ./aurweb:/aurweb/aurweb
- ./media:/aurweb/media
- ./migrations:/aurweb/migrations
- ./test:/aurweb/test
- ./web/html:/aurweb/web/html
- ./web/template:/aurweb/web/template
- ./web/lib:/aurweb/web/lib
- ./schema:/aurweb/schema
- ./templates:/aurweb/templates
- ./data/git_data:/aurweb/aur.git
- mariadb_run:/var/run/mysqld
ports:
- "127.0.0.1:18000:8000"
nginx:
image: mprweb:latest
init: true
entrypoint: /docker/nginx-entrypoint.sh
command: /docker/scripts/run-nginx.sh
ports:
- "8080:80" # FastAPI
healthcheck:
test: "bash /docker/health/nginx.sh"
interval: 2s
volumes:
- ./aurweb:/aurweb/aurweb
- ./docker:/docker
- ./data:/data
- archives:/var/lib/aurweb/archives
- smartgit_run:/var/run/smartgit
depends_on:
smartgit:
condition: service_healthy
fastapi:
condition: service_healthy
volumes:
mariadb_run: {} # Share /var/run/mysqld/mysqld.sock
mariadb_data: {} # Share /var/lib/mysql
smartgit_run: {}
archives: {}
step: {}