refactor: static internal traefik network config

This commit is contained in:
Iurii Tatishchev 2023-03-29 02:46:36 -07:00
parent a0d52958e8
commit a6c370b85a
Signed by: CaZzzer
GPG Key ID: 9A156B7DA6398968
3 changed files with 17 additions and 1 deletions

View File

@ -1,2 +1,6 @@
--- ---
my_svc_path: ~/services my_svc_path: ~/services
base_volume_path: /mnt/dock
media_volume_path: /mnt/media
traefik_ip: 172.16.122.254

View File

@ -17,6 +17,7 @@ SMTP_PASSWORD={{ sendgrid_api_key }}
MAIL_FROM_ADDRESS=nc MAIL_FROM_ADDRESS=nc
MAIL_DOMAIN=cazzzer.com MAIL_DOMAIN=cazzzer.com
TRUSTED_PROXIES={{ traefik_ip }}
OVERWRITEHOST=nc.{{ domain }} OVERWRITEHOST=nc.{{ domain }}
OVERWRITEPROTOCOL=https OVERWRITEPROTOCOL=https
OVERWRITECLIURL=https://nc.{{ domain }} OVERWRITECLIURL=https://nc.{{ domain }}

View File

@ -1,7 +1,12 @@
version: "3.9" version: "3.9"
networks: networks:
default:
traefik: traefik:
internal: true
ipam:
config:
- subnet: {{ traefik_ip }}/24
volumes: volumes:
logs: logs:
@ -10,6 +15,10 @@ services:
traefik: traefik:
image: traefik:v2.9 image: traefik:v2.9
container_name: traefik container_name: traefik
labels:
- traefik.enable=true
- traefik.http.routers.traefik.rule=Host(`traefik.{{ domain }}`)
- traefik.http.services.traefik.loadbalancer.server.port=8080
restart: unless-stopped restart: unless-stopped
ports: ports:
- "80:80" - "80:80"
@ -17,7 +26,9 @@ services:
env_file: env_file:
- .env.traefik - .env.traefik
networks: networks:
- traefik default:
traefik:
ipv4_address: {{ traefik_ip }}
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml:ro - ./traefik.yml:/etc/traefik/traefik.yml:ro