Set up TLS with Basic Auth
This commit is contained in:
@@ -26,6 +26,10 @@ services:
|
|||||||
configs:
|
configs:
|
||||||
- source: traefik_config
|
- source: traefik_config
|
||||||
target: /etc/traefik/traefik.yml
|
target: /etc/traefik/traefik.yml
|
||||||
|
secrets:
|
||||||
|
- traefik_password
|
||||||
|
- traefik_tls_cert
|
||||||
|
- traefik_tls_key
|
||||||
depends_on:
|
depends_on:
|
||||||
- docker
|
- docker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -92,5 +96,11 @@ configs:
|
|||||||
file: ${SERVICES_DIR?}/traefik/configs/traefik.yml
|
file: ${SERVICES_DIR?}/traefik/configs/traefik.yml
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
|
traefik_password:
|
||||||
|
file: ${SERVICES_DIR?}/traefik/secrets/htpasswd
|
||||||
|
traefik_tls_cert:
|
||||||
|
file: ${SERVICES_DIR?}/traefik/secrets/traefik.cert
|
||||||
|
traefik_tls_key:
|
||||||
|
file: ${SERVICES_DIR?}/traefik/secrets/traefik.key
|
||||||
portainer_password:
|
portainer_password:
|
||||||
file: ${SERVICES_DIR?}/portainer/secrets/portainer_password
|
file: ${SERVICES_DIR?}/portainer/secrets/portainer_password
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ entryPoints:
|
|||||||
web:
|
web:
|
||||||
address: :80
|
address: :80
|
||||||
http:
|
http:
|
||||||
# redirections:
|
redirections:
|
||||||
# entryPoint:
|
entryPoint:
|
||||||
# to: websecure
|
to: websecure
|
||||||
# scheme: https
|
scheme: https
|
||||||
websecure:
|
websecure:
|
||||||
address: :443
|
address: :443
|
||||||
http:
|
http:
|
||||||
|
|||||||
6
services/traefik/volumes/config/tls.yaml
Normal file
6
services/traefik/volumes/config/tls.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
tls:
|
||||||
|
stores:
|
||||||
|
default:
|
||||||
|
defaultCertificate:
|
||||||
|
certFile: /run/secrets/traefik.cert
|
||||||
|
keyFile: /run/secrets/traefik.key
|
||||||
@@ -3,3 +3,9 @@ http:
|
|||||||
traefik:
|
traefik:
|
||||||
rule: Host(`traefik.dev.dedicated.contact`)
|
rule: Host(`traefik.dev.dedicated.contact`)
|
||||||
service: api@internal
|
service: api@internal
|
||||||
|
middlewares: {}
|
||||||
|
#- traefik-auth
|
||||||
|
middlewares:
|
||||||
|
traefik-auth:
|
||||||
|
basicAuth:
|
||||||
|
usersFile: /run/secrets/htpasswd
|
||||||
|
|||||||
Reference in New Issue
Block a user