mirror of
https://github.com/KevinMidboe/schleppe-ha-project.git
synced 2026-01-26 02:25:40 +00:00
docker-compose resource definitions for web servers
This commit is contained in:
74
docker-compose/00_traefik/docker-compose.yml
Normal file
74
docker-compose/00_traefik/docker-compose.yml
Normal file
@@ -0,0 +1,74 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: "traefik:latest"
|
||||
container_name: traefik
|
||||
restart: unless-stopped
|
||||
|
||||
# PORTS
|
||||
ports:
|
||||
# HTTP entrypoint
|
||||
# Exposed on all external addresses (0.0.0.0:80)
|
||||
- "80:80"
|
||||
|
||||
# Traefik API & Dashboard
|
||||
# Accessible on http://<host>:8080
|
||||
- "8080:8080"
|
||||
|
||||
# COMMAND (STATIC CONFIGURATION)
|
||||
command:
|
||||
# Enable Traefik API & Dashboard
|
||||
- "--api.dashboard=true"
|
||||
- "--api.insecure=true"
|
||||
|
||||
# Log settings
|
||||
- "--log.level=INFO"
|
||||
- "--accesslog=true"
|
||||
|
||||
# EntryPoints
|
||||
- "--entrypoints.web.address=:80"
|
||||
- "--entrypoints.traefik.address=:8080"
|
||||
|
||||
# Docker provider
|
||||
- "--providers.docker=true"
|
||||
- "--providers.docker.exposedbydefault=false"
|
||||
|
||||
# Optional: file provider for dynamic config
|
||||
- "--providers.file.directory=/etc/traefik/dynamic"
|
||||
- "--providers.file.watch=true"
|
||||
|
||||
# Global settings
|
||||
- "--global.checknewversion=true"
|
||||
- "--global.sendanonymoususage=false"
|
||||
|
||||
# VOLUMES
|
||||
volumes:
|
||||
# Docker socket (required for Docker provider)
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
|
||||
# Dynamic configuration directory (middlewares, routers, TLS, etc.)
|
||||
- ./dynamic:/etc/traefik/dynamic:ro
|
||||
|
||||
# Logs (optional)
|
||||
- ./logs:/logs
|
||||
|
||||
# NETWORKS
|
||||
networks:
|
||||
- traefik
|
||||
|
||||
# LABELS (OPTIONAL SELF-ROUTING)
|
||||
labels:
|
||||
# Enable Traefik for this container
|
||||
- "traefik.enable=true"
|
||||
|
||||
# Router for dashboard (via Traefik itself)
|
||||
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)"
|
||||
- "traefik.http.routers.traefik.entrypoints=web"
|
||||
- "traefik.http.routers.traefik.service=api@internal"
|
||||
|
||||
# NETWORK DEFINITIONS
|
||||
networks:
|
||||
traefik:
|
||||
name: traefik
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user