-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (68 loc) · 2.62 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
services:
# https://doc.traefik.io/traefik/
global-traefik:
image: traefik:v2.10
restart: ${RESTART:-always}
labels:
# If you want to use traefik interface over a domain, enable it
- traefik.enable=false
- traefik.http.routers.global-traefik.rule=Host(`traefik.localhost`)
- traefik.http.services.global-traefik.loadbalancer.server.port=8080
# TLS
- traefik.http.routers.global-traefik.entrypoints=websecure
- traefik.http.routers.global-traefik.tls=true
# Protect the access by a username and a password
# htpasswd -nb admin "password" | sed -e s/\\$/\\$\\$/g
# docker run --rm httpd:2.4-alpine htpasswd -nbB admin "password" | sed -e s/\\$/\\$\\$/g
- traefik.http.routers.global-traefik.middlewares=auth
- traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$rCspsSTs$$oVNKLMVJIwtuLpYtPuXwt1
ports:
- "${HTTP_IP:-0.0.0.0}:${HTTP_PORT:-80}:80"
- "${HTTPS_IP:-0.0.0.0}:${HTTPS_PORT:-443}:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/traefik.yaml:/etc/traefik/traefik.yaml:ro
- ./.docker/traefik/acme/:/etc/traefik/acme/
- ./.docker/traefik/certs/:/etc/traefik/certs/
healthcheck:
test:
- CMD
- traefik
- healthcheck
interval: 10s
timeout: 5s
retries: 3
depends_on:
- global-serviceError
global-serviceError:
image: httpd:alpine
restart: always
hostname: status
container_name: global-serviceError
volumes:
- ./traefik/status-pages/public:/usr/local/apache2/htdocs
labels:
- traefik.enable=true
- traefik.http.routers.status-pages.rule=HostRegexp(`{host:.+}`)
- traefik.http.routers.status-pages.priority=1
#- traefik.http.routers.status-pages.entrypoints=web
- traefik.http.routers.status-pages.middlewares=status-pages@file
# TLS
- traefik.http.routers.status-pages.entrypoints=websecure
- traefik.http.routers.status-pages.tls=true
#- traefik.http.routers.status-pages.tls.certresolver=letsEncrypt
global-db:
image: mariadb:10.11
restart: ${RESTART:-always}
ports:
- "127.0.0.1:${DB_PORT:-3306}:3306"
volumes:
- ./.docker/global-db:/var/lib/mysql
environment:
- MARIADB_ROOT_PASSWORD=root
- MARIADB_AUTO_UPGRADE=1
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-allowed-packet=16MB --sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
networks:
default:
external: true
name: global