-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.override-example.yaml
More file actions
50 lines (45 loc) · 2.32 KB
/
docker-compose.override-example.yaml
File metadata and controls
50 lines (45 loc) · 2.32 KB
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
# check configs (both docker-compose files will merged):
# docker compose -f docker-compose.yaml -f docker-compose.override-example.yaml config
# start/stop:
# docker compose -f docker-compose.yaml -f docker-compose.override-example.yaml up -d
# docker compose -f docker-compose.yaml -f docker-compose.override-example.yaml down -v
version: '2.4'
services:
mariadb:
restart: unless-stopped
dht22:
restart: unless-stopped
web:
restart: unless-stopped
# In .env set "WEB_PORT=127.0.0.1:<YOUR-PORT>" for non public port, because we use traefik
# and set also "WEB_ENABLE_REMOTEIP=1"
#
# Traefik Docs: https://doc.traefik.io/traefik/
# Traefik example docker-compose: https://github.com/Tob1as/docker-kubernetes-collection/blob/master/examples_docker-compose/traefik_v3.yml
# url: http://my-raspberrypi-hostname/sensors/ (Note the slash at the end.)
networks:
- net-sensors
- traefik
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.services.rpi-sensors.loadbalancer.server.port=80"
- "traefik.http.services.rpi-sensors.loadbalancer.server.scheme=http" # when "https" then set "--serversTransport.insecureSkipVerify=true" for traefik
# http
- "traefik.http.routers.rpi-sensors-http.rule=(Host(`my-raspberrypi-hostname`) || Host(`192.168.1.100`)) && PathPrefix(`/sensors`)"
- "traefik.http.routers.rpi-sensors-http.entrypoints=web"
- "traefik.http.routers.rpi-sensors-http.service=rpi-sensors"
# https
- "traefik.http.routers.rpi-sensors-https.tls=true"
- "traefik.http.routers.rpi-sensors-https.rule=(Host(`my-raspberrypi-hostname`) || Host(`192.168.1.100`)) && PathPrefix(`/sensors`)"
- "traefik.http.routers.rpi-sensors-https.entrypoints=websecure"
- "traefik.http.routers.rpi-sensors-https.service=rpi-sensors"
# load middlewares for routers
- "traefik.http.routers.rpi-sensors-http.middlewares=rpi-sensors-stripprefix@docker"
- "traefik.http.routers.rpi-sensors-https.middlewares=rpi-sensors-stripprefix@docker"
# stripprefix <https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/stripprefix/>
- "traefik.http.middlewares.rpi-sensors-stripprefix.stripprefix.prefixes=/sensors"
networks:
traefik:
external: true
name: traefik