-
Notifications
You must be signed in to change notification settings - Fork 202
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 #6 from khast3x/dev - Traefik
Traefik now replaces NGINX
- Loading branch information
Showing
13 changed files
with
240 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,85 @@ | ||
version: '2' | ||
version: "3" | ||
|
||
services: | ||
cert_gen: | ||
image: paulczar/omgwtfssl | ||
volumes: | ||
- /tmp/certs:/certs | ||
|
||
proxy: | ||
build: nginx/ | ||
container_name: "portainer-proxy" | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes_from: | ||
- cert_gen | ||
volumes: | ||
- files:/etc/nginx/html/files | ||
restart: on-failure | ||
container_name: "cert-gen" | ||
image: paulczar/omgwtfssl | ||
volumes: | ||
- certs:/certs | ||
labels: | ||
- "traefik.enable=false" | ||
|
||
templates: | ||
build : nginx-templates/ | ||
container_name: "nginx-templates" | ||
traefik: | ||
build: traefik/ | ||
container_name: "traefik" | ||
networks: | ||
- default | ||
- inside | ||
ports: | ||
- "8080:80" | ||
- 80:80 | ||
- 443:443 | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- certs:/certs | ||
- logs:/logs | ||
labels: | ||
- "traefik.frontend.rule=PathPrefixStrip:/api" | ||
- "traefik.frontend.auth.basic.usersFile=/etc/traefik/.htpasswd" | ||
- "traefik.port=8081" | ||
|
||
|
||
|
||
|
||
templates: | ||
build : templates/ | ||
container_name: "templates" | ||
networks: | ||
- inside | ||
labels: | ||
- "traefik.enable=false" | ||
|
||
public-files: | ||
image: aikain/simplehttpserver:0.1 | ||
container_name: "public-files" | ||
volumes: | ||
- files:/var/www/ | ||
- logs:/var/www/logs | ||
networks: | ||
- inside | ||
labels: | ||
- "traefik.sec.frontend.rule=PathPrefixStrip:/files/logs" | ||
- "traefik.sec.port=80" | ||
- "traefik.sec.frontend.auth.basic.users=admin:$$apr1$$JWufnu2u$$jK16K8EczmfIBDk5p3xw6/" | ||
- "traefik.nosec.frontend.rule=PathPrefixStrip:/files" | ||
- "traefik.nosec.port=80" | ||
|
||
|
||
portainer: | ||
image: portainer/portainer | ||
container_name: "portainer-app" | ||
command: --host=unix:///var/run/docker.sock --logo "https://i.imgur.com/lwVlWt2.jpg" --templates "http://nginx-templates/templates.yml" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /opt/portainer/data:/data | ||
networks: | ||
- default | ||
- inside | ||
|
||
# tester: | ||
# image: nginx:latest | ||
# container_name: "tester" | ||
# networks: | ||
# - default | ||
# - inside | ||
image: portainer/portainer | ||
container_name: "portainer-app" | ||
networks: | ||
- inside | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /opt/portainer/data:/data | ||
command: --host=unix:///var/run/docker.sock --logo "https://i.imgur.com/lwVlWt2.jpg" --templates "http://templates/templates.yml" | ||
|
||
labels: | ||
- "traefik.frontend.rule=PathPrefixStrip:/portainer" | ||
- "traefik.port=9000" | ||
- "traefik.passHostHeader=true" | ||
- "traefik.docker.network=redcloud_inside" | ||
- "traefik.backend.loadbalancer.swarm=true" | ||
- "traefik.backend.loadbalancer.method=drr" | ||
# https://github.com/containous/traefik/issues/563#issuecomment-421360934 | ||
- "traefik.frontend.redirect.regex=^(.*)/portainer$$" | ||
- "traefik.frontend.redirect.replacement=$$1/portainer/" | ||
- "traefik.frontend.rule=PathPrefix:/portainer;ReplacePathRegex: ^/portainer/(.*) /$$1" | ||
|
||
volumes: | ||
certs: | ||
logs: | ||
files: | ||
|
||
networks: | ||
inside: | ||
inside: | ||
external: false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
FROM aikain/simplehttpserver:0.1 | ||
COPY templates.yml /var/www/ | ||
|
||
CMD python3 -m http.server 80 |
File renamed without changes.
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,2 @@ | ||
|
||
admin:$apr1$4YJyomU4$FdUTOixMsICBBBz9PHJLH0 |
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,6 @@ | ||
FROM traefik:alpine | ||
|
||
COPY traefik.toml /etc/traefik/traefik.toml | ||
# admin:Redcloud | ||
COPY .htpasswd /etc/traefik/.htpasswd | ||
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,37 @@ | ||
defaultEntryPoints = ["http", "https"] | ||
logLevel = "DEBUG" | ||
|
||
[traefikLog] | ||
filePath = "/logs/traefik.log" | ||
|
||
[accessLog] | ||
filePath = "/logs/access.log" | ||
|
||
[entryPoints.api] | ||
address = ":8081" | ||
[entryPoints] | ||
[entryPoints.http] | ||
address = ":80" | ||
[entryPoints.http.redirect] | ||
entryPoint = "https" | ||
rule = "Path:/portainer,/files,/api" | ||
[entryPoints.https] | ||
address = ":443" | ||
[entryPoints.https.tls] | ||
[[entryPoints.https.tls.certificates]] | ||
ca = "/certs/ca.pem" | ||
caOptional = true | ||
certFile = "/certs/cert.pem" | ||
keyFile = "/certs/key.pem" | ||
insecureSkipVerify = true | ||
|
||
|
||
[docker] | ||
endpoint = "unix:///var/run/docker.sock" | ||
domain = "docker.localhost" | ||
exposedByDefault = true | ||
|
||
[api] | ||
entryPoint = "api" | ||
|
||
|