-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from david-loe/feat/tls-in-dev
Add TLS for dev setup
- Loading branch information
Showing
7 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM traefik:v3.0 | ||
|
||
# Installiere OpenSSH auf einem Alpine-basierten Image | ||
RUN apk update && apk add --no-cache openssl | ||
|
||
# Kopiere das Skript in das Container-Image | ||
COPY gen-certs.sh / | ||
|
||
# Mache das Skript ausführbar | ||
RUN chmod +x /gen-certs.sh | ||
|
||
# Setze das Skript als Entrypoint | ||
ENTRYPOINT ["/gen-certs.sh"] | ||
|
||
# Setze Standardbefehle | ||
CMD ["traefik"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
tls: | ||
certificates: | ||
- certFile: /certificates/abrechnung.crt | ||
keyFile: /certificates/abrechnung.key | ||
|
||
http: | ||
routers: | ||
backend: | ||
rule: 'Host(`{{ env "TLS_CERT_CN" }}`) && PathPrefix(`/backend`)' | ||
service: backend-abrechnung@docker | ||
entryPoints: | ||
- https | ||
tls: {} | ||
middlewares: | ||
- stripprefix-backend | ||
|
||
frontend: | ||
rule: 'Host(`{{ env "TLS_CERT_CN" }}`)' | ||
service: frontend-abrechnung@docker | ||
entryPoints: | ||
- https | ||
tls: {} | ||
|
||
middlewares: | ||
stripprefix-backend: | ||
stripPrefix: | ||
prefixes: | ||
- '/backend' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
# Verzeichnis für Zertifikate erstellen | ||
mkdir -p /certificates | ||
|
||
# Generiere den privaten Schlüssel | ||
openssl genrsa -out /certificates/abrechnung.key 2048 | ||
|
||
# Generiere ein selbstsigniertes Zertifikat | ||
openssl req -new -x509 -nodes -sha256 -days 3650 \ | ||
-key /certificates/abrechnung.key \ | ||
-out /certificates/abrechnung.crt \ | ||
-subj "/C=DE/ST=State/L=City/O=Company/OU=Department/CN=${TLS_CERT_CN}" | ||
|
||
# Starte Traefik | ||
exec traefik "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
entryPoints: | ||
https: | ||
address: ':443' | ||
|
||
providers: | ||
docker: | ||
exposedByDefault: true | ||
file: | ||
filename: '/etc/traefik/config.yml' | ||
|
||
api: | ||
dashboard: true | ||
insecure: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters