-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
73 lines (67 loc) · 2.2 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
version: '3.8'
volumes:
db: {}
images: {}
services:
db:
image: mariadb
restart: unless-stopped
volumes:
- db:/var/lib/mysql
environment:
- MYSQL_DATABASE=wiki
- MYSQL_RANDOM_ROOT_PASSWORD=yes
env_file:
- .config
wiki:
image: lego3410/wiki:latest
build:
context: ./compose
dockerfile: ../Dockerfile
args:
MEDIAWIKI_VERSION: 1.34.2
hostname: ${HOST}
restart: unless-stopped
networks:
- default
- proxy
volumes:
- images:/var/www/html/images
env_file:
- .config
- .env
labels:
# Router for catching local access
- "traefik.http.routers.wiki-local.rule=Host(`localhost`, `127.0.0.1`)"
- "traefik.http.routers.wiki-local.middlewares=replace_w"
# Router for catching global http access. Redirect to main one
- "traefik.http.routers.wiki-global.rule=Host(`${HOST}`) && PathPrefix(`${WG_PATH}/`, `${WG_SCRIPTPATH}/`) || Path(`/`, `${WG_PATH}`)"
- "traefik.http.routers.wiki-global.middlewares=redirecter"
- "traefik.http.routers.wiki-global.tls=false"
- "traefik.http.routers.wiki-global.priority=1" # set to be lowest priority
# The main router for catching global https access
- "traefik.http.routers.wiki.rule=Host(`${HOST}`) && PathPrefix(`${WG_PATH}/`, `${WG_SCRIPTPATH}/`) || Path(`/`, `${WG_PATH}`)"
- "traefik.http.routers.wiki.tls=true"
- "traefik.http.routers.wiki.tls.certresolver=letsencrypt"
- "traefik.http.routers.wiki.middlewares=replace_w"
# strip /w from uri
- "traefik.http.middlewares.replace_w.replacepathregex.regex=^/w/(.*)"
- "traefik.http.middlewares.replace_w.replacepathregex.replacement=/$$1"
# redirect from http to https for request not from localhost
- "traefik.http.middlewares.redirecter.redirectscheme.scheme=https"
parsoid:
image: thenets/parsoid:0.11
restart: unless-stopped
environment:
- PARSOID_DOMAIN_wiki=http://wiki/api.php
# elasticsearch:
# image: elasticsearch:6.5.4
# ports:
# - 9200:9200
# - 9300:9300
# environment:
# - discovery.type=single-node
networks:
proxy:
external:
name: proxy_default