1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00

create traefik

This commit is contained in:
Nebel 2022-12-31 03:30:26 +09:00
parent e48d0b2c2f
commit 78312c01b1
2 changed files with 22 additions and 0 deletions

17
traefik/compose.yml Normal file
View file

@ -0,0 +1,17 @@
services:
traefik:
image: traefik:v2.9
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.yml:/etc/traefik/traefik.yml
# Traefikでのサービス名は {Docker Composeでのサービス名}-{Docker Composeでのプロジェクト名} のようになる
# https://github.com/traefik/traefik/blob/e54ee89330a800d509da7b11b46a6ecbb331e791/pkg/provider/docker/config.go#L412-L420
# そうでない場合はコンテナ名
# --providers.docker.defaultRule: Host(`{{ .Name }}.localhost`)
# … {{ .Name }} はTraefikでのサービス名に置換される
nginx:
image: nginx:alpine

5
traefik/traefik.yml Normal file
View file

@ -0,0 +1,5 @@
api:
insecure: true
providers:
docker:
defaultRule: Host(`{{ .Name }}.localhost`)