mirror of
https://github.com/PAPAMICA/docker-compose-collection.git
synced 2026-01-18 16:27:25 +01:00
53 lines
2.1 KiB
YAML
53 lines
2.1 KiB
YAML
# Maintainer: Mickael "PAPAMICA" Asseline
|
|
# Update: 2022-05-12
|
|
|
|
#& type: 3
|
|
#& title: Traefik
|
|
#& description: Perfect proxy for Docker environment
|
|
#& note: Website: <a href='https://traefik.io/traefik/' target='_blank' rel='noopener'>Traefik.io</a></br>Ports to open: 80, 443</br>You need to create these files: traefik.yml, config.yml, acme.json</br>Check my repo <a href='https://github.com/PAPAMICA/docker-environment' target='_blank' rel='noopener'>PAPAMICA/docker-environment</a>
|
|
#& categories: SelfHosted, PAPAMICA
|
|
#& platform: linux
|
|
#& logo: https://img.papamica.com/logo/traefik.png
|
|
|
|
#% SERVICE: Name of the service (No spaces or points) [traefik]
|
|
#% DATA_LOCATION: Data localization (Example: /apps/service) [/_data/apps]
|
|
#% URL: Service URL (Example: service.papamica.fr or service.com)
|
|
#% NETWORK: Your Traefik network (Example: proxy, you need to create it before) [proxy]
|
|
#% ADMIN_PASS: Admin user and password (Format: USER:{SHA}XXXXXXXXXXXXXXXX)
|
|
|
|
# Work with Portainer
|
|
version: "3.3"
|
|
services:
|
|
traefik:
|
|
image: traefik:latest
|
|
container_name: $SERVICE
|
|
restart: always
|
|
healthcheck:
|
|
test: grep -qr "traefik" /proc/*/status || exit 1
|
|
interval: 1m
|
|
timeout: 30s
|
|
retries: 3
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
volumes:
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- $DATA_LOCATION/$SERVICE/config/traefik.yml:/traefik.yml:ro
|
|
- $DATA_LOCATION/$SERVICE/config/config.yml:/config.yml:ro
|
|
- $DATA_LOCATION/$SERVICE/config/acme.json:/acme.json
|
|
labels:
|
|
autoupdate: "monitor"
|
|
traefik.enable: true
|
|
traefik.http.routers.$SERVICE.entrypoints: https
|
|
traefik.http.routers.$SERVICE.rule: Host("$URL")
|
|
traefik.http.routers.$SERVICE.service: api@internal
|
|
traefik.http.routers.$SERVICE.middlewares: auth
|
|
traefik.http.middlewares.auth.basicauth.users: $ADMIN_PASS
|
|
networks:
|
|
- default
|
|
|
|
networks:
|
|
default:
|
|
external:
|
|
name: $NETWORK |