mirror of
https://github.com/Haxxnet/Compose-Examples.git
synced 2026-02-14 08:44:25 +01:00
fix: remove deprecated compose version tag
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
# This docker compose example configures traefik by command definitions.
|
||||
# This makes the traefik.yml static configuration obsolete.
|
||||
# Note that we still reference a dynamic configuration for best practice
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:2.11
|
||||
container_name: traefik
|
||||
restart: always
|
||||
command:
|
||||
- --providers.docker=true # enable docker provider
|
||||
- --providers.docker.network=proxy # define default network to monitor for docker provider
|
||||
@@ -52,9 +51,11 @@ services:
|
||||
ports:
|
||||
- 80:80 # http
|
||||
- 443:443 # https
|
||||
- 127.0.0.1:8080:8080 # traefik api dashboard
|
||||
networks:
|
||||
- proxy # define traefik docker network
|
||||
- 127.0.0.1:8080:8080 # http api dashboard
|
||||
expose:
|
||||
- 80 # http
|
||||
- 443 # https
|
||||
- 8080 # http api dashboard
|
||||
environment:
|
||||
- TZ=Europe/Berlin # define timezone
|
||||
- CF_DNS_API_TOKEN=<MY-CF-API-TOKEN> # define your cloudflare api token
|
||||
@@ -62,9 +63,10 @@ services:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # pass docker socket as read-only
|
||||
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/traefik:/etc/traefik/ # bind mount volume for persistent traefik data
|
||||
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/traefik/logs:/logs # bind mount volume for persistent traefik logs
|
||||
restart: always # always restart traefik
|
||||
extra_hosts:
|
||||
- host.docker.internal:172.17.0.1 # define internal ip; helps traefik to resolve containers running in host network mode
|
||||
networks:
|
||||
- proxy # define traefik docker network
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
version: '3'
|
||||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:v3.1
|
||||
container_name: traefik
|
||||
image: traefik:v3.1
|
||||
restart: always
|
||||
ports:
|
||||
- 80:80/tcp # HTTP
|
||||
- 443:443/tcp # HTTPS
|
||||
- 443:443/udp # HTTPS via HTTP/3 QUIC UDP
|
||||
- 127.0.0.1:8080:8080 # MGMT WEB UI
|
||||
- 80:80/tcp # http
|
||||
- 443:443/tcp # https
|
||||
- 443:443/udp # https http3 quic
|
||||
- 127.0.0.1:8080:8080 # http api dashboard
|
||||
expose:
|
||||
- 80 # http
|
||||
- 443 # https
|
||||
- 8080 # http api dashboard
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro # ro = read-only access to the docker.sock
|
||||
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/traefik:/etc/traefik/ # put the provided traefik.yml and fileConfig.yml files at this location
|
||||
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/traefik/logs:/logs
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
- TZ=Europe/Berlin
|
||||
- CF_DNS_API_TOKEN=MyCloudflareApiToken # change this if you use Cloudflare
|
||||
@@ -23,10 +26,11 @@ services:
|
||||
- traefik.http.routers.api.service=api@internal # Enable Traefik API.
|
||||
- traefik.http.routers.api.middlewares=local-ipwhitelist@file,basic-auth@file # protect dashboard with basic auth and restrict access to private class subnets only
|
||||
#- traefik.http.middlewares.basic-auth-global.basicauth.users=admin:$$apr1$$epoKf5li$$QfTMJZOCS/halv3CiIUEu0 # protect the traefik dashboard by basic auth (pw=password)
|
||||
restart: always
|
||||
extra_hosts:
|
||||
- host.docker.internal:172.17.0.1
|
||||
networks:
|
||||
- proxy
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
external: true
|
||||
Reference in New Issue
Block a user