-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
122 lines (105 loc) · 3.55 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
version: '3'
services:
traefik:
image: "traefik:v2.9"
container_name: "traefik"
command:
# - "--log.level=DEBUG"
- "--api.dashboard=true"
#docker
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=web"
#http to https
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
- "--entrypoints.websecure.address=:443"
#SSl
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
# - "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=${acme_email}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
labels:
# Dashboard api
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`${domain}`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- 'traefik.http.routers.dashboard.entrypoints=websecure'
- 'traefik.http.routers.dashboard.tls.certresolver=myresolver'
- 'traefik.http.routers.dashboard.service=api@internal'
- 'traefik.http.routers.dashboard.middlewares=auth'
- "traefik.http.middlewares.auth.basicauth.users=${dashboardcreds}"
# Dummy service for Swarm port detection. The port can be any valid integer value.
- '[email protected]=8080'
ports:
- "443:443"
- "80:80"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- web
ffserver:
build: .
environment:
- port=:5000
- privPEM=$privPEM
- pubPEM=$pubPEM
- dbUser=$dbUser
- dbPassword=$dbUserPass
- dbName=$dbName
labels:
- "traefik.enable=true"
- "traefik.http.routers.ffserver.rule=Host(`${domain}`) && (PathPrefix(`/admin`) || PathPrefix(`/crowd`))"
- "traefik.http.middlewares.cors-headers.headers.accesscontrolalloworiginlist=*"
- "traefik.http.routers.ffserver.middlewares=cors-headers"
- "traefik.http.routers.ffserver.entrypoints=websecure"
- "traefik.http.routers.ffserver.tls.certresolver=myresolver"
- "traefik.port=5000"
restart: on-failure
depends_on:
- db
networks:
- web
- internal
db:
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: $dbRootPass
MYSQL_DATABASE: $dbName
MYSQL_USER: $dbUser
MYSQL_PASSWORD: $dbUserPass
restart: on-failure
volumes:
- database_mysql:/var/lib/mysql
- type: bind
source: ./config/sql-scripts/
target: /docker-entrypoint-initdb.d
labels:
- traefik.enable=false
networks:
- internal
adminer:
image: adminer
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`${domain}`) && PathPrefix(`/db`)"
- "traefik.http.middlewares.db-auth.basicauth.users=${db_access_creds}"
- "traefik.http.routers.adminer.middlewares=db-auth"
- "traefik.http.routers.adminer.entrypoints=websecure"
- "traefik.http.routers.adminer.tls.certresolver=myresolver"
- "traefik.port=8080"
networks:
- web
- internal
depends_on:
- db
volumes:
database_mysql:
networks:
web:
external: true
internal:
external: false