forked from SaillantNicolas/cgalmediawiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
100 lines (93 loc) · 2.57 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
secrets:
cgal_password:
external: true
name: "CGAL_MEMBERS_PASSWORD"
x-cgal-env: &cgal-env
MW_SITE_FQDN: ${MW_SITE_FQDN:-http://localhost:8080}
MEDIAWIKI_SITE_SERVER: ${MW_SITE_FQDN:-http://localhost:8080}
MEDIAWIKI_SITE_NAME: My MediaWiki
MEDIAWIKI_DB_TYPE: mysql
MEDIAWIKI_DB_HOST: db
MEDIAWIKI_DB_NAME: mediawiki
MEDIAWIKI_DB_USER: mediawiki
MEDIAWIKI_DB_PASSWORD: mediawiki
MYSQL_DATABASE: mediawiki
MYSQL_USER: mediawiki
MYSQL_PASSWORD: mediawiki
MYSQL_ROOT_PASSWORD: root
HTTPS_PORT: ${HTTPS_PORT:-8443}
HTTP_PORT: ${HTTP_PORT:-8080}
HTTP_TEST_PORT: ${HTTP_TEST_PORT:-8080}
services:
mediawiki:
build:
context: .
profiles:
- production
- test
restart: always
volumes: &volumes_mediawiki
- ./LocalSettings.php:/var/www/html/LocalSettings.php
- ./composer.json:/var/www/html/composer.json
- ./images:/var/www/html/images
- ./config/cgal_wiki_httpd.conf:/etc/apache2/conf-available/short-url.conf
environment: *cgal-env
ports:
- "${HTTP_TEST_PORT:-127.0.0.1:8080}:80"
depends_on:
db:
condition: service_healthy
db:
image: mariadb
restart: always
profiles:
- update_db
- production
- test
environment: *cgal-env
volumes:
- ./db-init:/docker-entrypoint-initdb.d
- db-data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 20s
timeout: 10s
retries: 3
start_period: 40s
caddy:
image: docker.io/library/caddy:2.8-alpine
restart: unless-stopped
entrypoint: caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
environment:
<<: *cgal-env
CGAL_MEMBERS_PASSWORD:
profiles:
- production
ports:
- "${SERVER_IP:-0.0.0.0}:${HTTPS_PORT:-8443}:${HTTPS_PORT:-8443}"
- "${SERVER_IP:-0.0.0.0}:${HTTPS_PORT:-8443}:${HTTPS_PORT:-8443}/udp"
- "${SERVER_IP:-0.0.0.0}:${HTTP_PORT:-8080}:${HTTP_PORT:-8080}"
volumes:
- caddy-data:/data
- ./config/Caddyfile:/etc/caddy/Caddyfile
depends_on:
- mediawiki
update_db:
build:
context: .
args:
- MW_VERSION=1.31
- UPDATE=1
profiles:
- update_db
environment: *cgal-env
volumes:
- ./update-context/LocalSettings.php:/var/www/html/LocalSettings.php
- ./update-context/composer.json:/var/www/html/composer.json
entrypoint: [ "php", "maintenance/update.php", "--quick" ]
depends_on:
db:
condition: service_healthy
volumes:
db-data:
caddy-data: