Replace Traefik with Caddy as proxy
This commit is contained in:
parent
fdd4b6faf1
commit
a3944d3867
10 changed files with 69 additions and 122 deletions
52
proxy/Caddyfile
Normal file
52
proxy/Caddyfile
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
auto_https off
|
||||
}
|
||||
|
||||
http://whoami.lan {
|
||||
reverse_proxy whoami:80
|
||||
}
|
||||
|
||||
http://dashboard.lan {
|
||||
reverse_proxy homer:8080
|
||||
}
|
||||
|
||||
http://hassi.lan {
|
||||
# reverse_proxy homeassistant:8123
|
||||
reverse_proxy dockerhost-1.lan:8123
|
||||
}
|
||||
|
||||
http://zigbee2mqtt.lan {
|
||||
reverse_proxy zigbee2mqtt:8080
|
||||
}
|
||||
|
||||
http://jellyfin.lan {
|
||||
reverse_proxy jellyfin:8096
|
||||
}
|
||||
|
||||
http://paperless.lan {
|
||||
reverse_proxy paperless-ngx:8000
|
||||
}
|
||||
|
||||
http://download.lan {
|
||||
reverse_proxy pyload:8000
|
||||
}
|
||||
|
||||
http://monitoring.lan {
|
||||
reverse_proxy grafana:3000
|
||||
}
|
||||
|
||||
http://influxdb.lan {
|
||||
reverse_proxy influxdb:8086
|
||||
}
|
||||
|
||||
http://uptime.lan {
|
||||
reverse_proxy uptime-kuma:3001
|
||||
}
|
||||
|
||||
http://torrent.lan {
|
||||
reverse_proxy transmission:9091
|
||||
}
|
||||
|
||||
:80, :443 {
|
||||
respond 404
|
||||
}
|
|
@ -1,54 +1,25 @@
|
|||
services:
|
||||
|
||||
traefik:
|
||||
image: traefik:${TRAEFIK_VERSION}
|
||||
restart: always
|
||||
caddy:
|
||||
image: caddy:2
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- 80:80
|
||||
volumes:
|
||||
- ${VOLUMES_PATH}/proxy/caddy/data:/data
|
||||
- ${VOLUMES_PATH}/proxy/caddy/config:/config
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
networks:
|
||||
- web
|
||||
- dockersocket
|
||||
volumes:
|
||||
- "$PWD/traefik.yml:/etc/traefik/traefik.yml"
|
||||
- "$PWD/extraProviders/:/extraProviders:ro"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik.rule=Host(`traefik.${HOSTNAME}`)"
|
||||
- "traefik.http.routers.traefik.entrypoints=web"
|
||||
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
|
||||
- "docker.group=proxy"
|
||||
extra_hosts:
|
||||
- host.docker.internal:host-gateway
|
||||
depends_on:
|
||||
- docker-socket-proxy
|
||||
|
||||
|
||||
docker-socket-proxy:
|
||||
image: tecnativa/docker-socket-proxy
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
environment:
|
||||
# grant privileges as environment variables: https://github.com/Tecnativa/docker-socket-proxy#grant-or-revoke-access-to-certain-api-sections
|
||||
- CONTAINERS=1
|
||||
- INFO=1
|
||||
whoami:
|
||||
image: containous/whoami
|
||||
networks:
|
||||
- dockersocket
|
||||
privileged: true
|
||||
|
||||
|
||||
# whoami:
|
||||
# image: containous/whoami
|
||||
# networks:
|
||||
# - web
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.whoami.rule=Host(`whoami.${HOSTNAME}`)"
|
||||
# - "traefik.http.routers.whoami.entrypoints=web"
|
||||
# - "traefik.http.services.whoami.loadbalancer.server.port=80"
|
||||
# - "docker.group=proxy"
|
||||
# restart: unless-stopped
|
||||
- web
|
||||
labels:
|
||||
- "docker.group=proxy"
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
networks:
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
debug: true
|
||||
checkNewVersion: true
|
||||
logLevel: INFO
|
||||
#defaultEntryPoints: ["https","http"]
|
||||
defaultEntryPoints: [http]
|
||||
|
||||
api:
|
||||
insecure: true
|
||||
|
||||
providers:
|
||||
docker:
|
||||
exposedbydefault: false
|
||||
endpoint: "tcp://docker-socket-proxy:2375"
|
||||
|
||||
file:
|
||||
directory: /extraProviders
|
||||
|
||||
|
||||
entryPoints:
|
||||
web:
|
||||
address: ':80'
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue