Compare commits
4 Commits
55d174e16b
...
testing
Author | SHA1 | Date | |
---|---|---|---|
|
e1c3f4d2b9 | ||
|
2b81e486fc | ||
|
d3c4eb3e11 | ||
|
49e1a85ef2 |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 docker
|
||||
Copyright (c) 2023 altogether
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
24
README.md
24
README.md
@@ -1,11 +1,11 @@
|
||||
# traefik
|
||||
|
||||
### get started
|
||||
## get started
|
||||
|
||||
you will need a .env file
|
||||
|
||||
sample .env:
|
||||
|
||||
|
||||
# .env
|
||||
|
||||
PROJECT_NAME=sample
|
||||
@@ -16,8 +16,24 @@ place the tls crt and key in the tls-data
|
||||
and append them also to the tls.yml
|
||||
|
||||
|
||||
then execute init
|
||||
then execute init with
|
||||
|
||||
chmod +x init && ./init
|
||||
|
||||
now traefik gui should be accessable: https://${PROJECT_URL}
|
||||
if you use the sample .env: https://localhost
|
||||
|
||||
|
||||
### additional links
|
||||
## test your compose network
|
||||
|
||||
to test your traefik network you can start the whoami compose with:
|
||||
|
||||
docker compose -f ./docker-compose-whoami.yml up -d
|
||||
|
||||
you can stop the whoami with
|
||||
|
||||
docker compose -f ./docker-compose-whoami.yml down -v
|
||||
|
||||
|
||||
## additional links
|
||||
- [traefik docu](https://doc.traefik.io/traefik/)
|
@@ -1,4 +1,4 @@
|
||||
version: "1.0"
|
||||
version: "3.8"
|
||||
|
||||
networks:
|
||||
default:
|
||||
@@ -16,16 +16,17 @@ services:
|
||||
- "./traefik.yml:/traefik.yml:ro"
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "./tls.yml:/etc/traefik/dynamic_conf/conf.yml:ro"
|
||||
- "./acme.json:/certificates/acme.json"
|
||||
- "./tls-data:/tls:ro"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=${TRAEFIK_NETWORK}"
|
||||
|
||||
# HTTP -> HTTPS
|
||||
- "traefik.http.routers.http-catchall.entrypoints=web"
|
||||
- "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
|
||||
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
|
||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||
#- "traefik.http.routers.http-catchall.entrypoints=web"
|
||||
#- "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
|
||||
#- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
|
||||
#- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||
|
||||
# HTTPS Routers
|
||||
- "traefik.http.routers.${PROJECT_NAME}_traefik.rule=Host(`${PROJECT_URL}`)"
|
||||
|
12
tls.yml
12
tls.yml
@@ -17,5 +17,13 @@ tls:
|
||||
certificates:
|
||||
- certFile: /tls/CF-altogether.at.crt
|
||||
keyFile: /tls/CF-altogether.at.key
|
||||
stores:
|
||||
- default
|
||||
|
||||
- certFile: /tls/wordpress.localhost.crt
|
||||
keyFile: /tls/wordpress.localhost.key
|
||||
options:
|
||||
default:
|
||||
clientAuth:
|
||||
# in PEM format. each file can contain multiple CAs.
|
||||
caFiles:
|
||||
- /tls/server.crt
|
||||
clientAuthType: VerifyClientCertIfGiven
|
26
traefik.yml
26
traefik.yml
@@ -1,6 +1,16 @@
|
||||
## STATIC CONFIGURATION
|
||||
global:
|
||||
checkNewVersion: true
|
||||
sendAnonymousUsage: false
|
||||
|
||||
log:
|
||||
level: INFO
|
||||
level: "INFO"
|
||||
|
||||
accessLog:
|
||||
filePath: "/logs/access.log"
|
||||
bufferingSize: 100 # Configuring a buffer of 100 lines
|
||||
filters:
|
||||
statusCodes: "204-299,400"
|
||||
|
||||
api:
|
||||
insecure: true
|
||||
@@ -18,15 +28,25 @@ entryPoints:
|
||||
http:
|
||||
middlewares:
|
||||
- secureHeaders@file
|
||||
minecraft:
|
||||
address: ':25565/tcp'
|
||||
ssh:
|
||||
address: ":22"
|
||||
|
||||
providers:
|
||||
docker:
|
||||
endpoint: "unix:///var/run/docker.sock"
|
||||
# endpoint: "tcp://dockerproxy:2375"
|
||||
exposedByDefault: false
|
||||
# endpoint: "tcp://dockerproxy:2375"
|
||||
# swarmMode: false
|
||||
# network: "socket_proxy"
|
||||
file:
|
||||
directory: "/etc/traefik/dynamic_conf"
|
||||
watch: true
|
||||
directory: "/etc/traefik/dynamic_conf"
|
||||
|
||||
certificatesresolvers:
|
||||
le:
|
||||
acme:
|
||||
email: "raphy.martin@protonmail.ch"
|
||||
storage: "/certificates/acme.json"
|
||||
tlschallenge: true
|
Reference in New Issue
Block a user