feat: Add Traefik container
This commit is contained in:
commit
c82df61c15
2
traefik/.env.example
Normal file
2
traefik/.env.example
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
NAS_DOMAIN=nas.example.org
|
||||||
|
NAS_URL=http://0.0.0.0:80
|
||||||
2
traefik/.gitignore
vendored
Normal file
2
traefik/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
acme.json
|
||||||
11
traefik/README.md
Normal file
11
traefik/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# About Traefik
|
||||||
|
|
||||||
|
# How to setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker network create web
|
||||||
|
touch acme.json
|
||||||
|
chmod 600 acme.json
|
||||||
|
cp .env.example .env # then edit
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
45
traefik/docker-compose.yml
Normal file
45
traefik/docker-compose.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
version: "3.3"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
web:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
traefik:
|
||||||
|
image: "traefik:v2.10"
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- web
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
# - "8080:8080"
|
||||||
|
command:
|
||||||
|
# Entrypoints
|
||||||
|
- "--entrypoints.web.address=:80"
|
||||||
|
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
||||||
|
- "--entrypoints.websecure.address=:443"
|
||||||
|
- "--entrypoints.websecure.http.tls.certresolver=letsencrypt"
|
||||||
|
# Docker provider
|
||||||
|
- "--providers.docker"
|
||||||
|
- "--providers.docker.exposedbydefault=false"
|
||||||
|
- "--providers.docker.network=web"
|
||||||
|
# Let's encrypt
|
||||||
|
- "--certificatesresolvers.letsencrypt.acme.email=${CERT_EMAIL}"
|
||||||
|
# File provider
|
||||||
|
- "--providers.file.directory=/conf.d/"
|
||||||
|
- "--providers.file.watch=true"
|
||||||
|
# Dashboard
|
||||||
|
# - "--api.dashboard=true"
|
||||||
|
# - "--api.insecure=true"
|
||||||
|
environment:
|
||||||
|
NAS_DOMAIN: ${NAS_DOMAIN}
|
||||||
|
NAS_URL: ${NAS_URL}
|
||||||
|
volumes:
|
||||||
|
- "./conf.d:/conf.d"
|
||||||
|
- "./acme.json:/acme.json"
|
||||||
|
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
||||||
Loading…
x
Reference in New Issue
Block a user