Skip to content

Commit

Permalink
traefik v2
Browse files Browse the repository at this point in the history
  • Loading branch information
devosc committed Apr 17, 2020
1 parent 6e14270 commit 2484dbe
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bin/docker-create-project
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function create_docker_compose_file()
rm "${compose_file}.bak"

echo "Host: ${host}"
sed -i.bak "s#Host:.*#Host:${host}#g" "${compose_file}"
sed -i.bak "s#Host(.*#Host(\\\`${host}\\\`)#g" "${compose_file}"
rm "${compose_file}.bak"

echo "Document root: ${document_root}"
Expand Down
14 changes: 10 additions & 4 deletions traefik/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ networks:

services:
proxy:
image: traefik:v1.7.24
command: --api --docker
image: traefik
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --api
container_name: traefik
labels:
- traefik.frontend.rule=Host:traefik
- traefik.port=8080
- "traefik.http.routers.proxy.rule=Host(`traefik`)"
- "traefik.http.routers.proxy.entrypoints=websecure"
- "traefik.http.routers.proxy.service=api@internal"
- "traefik.http.routers.proxy.tls=true"
networks:
- webgateway
ports:
Expand Down
36 changes: 17 additions & 19 deletions traefik/traefik-sample.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
[entryPoints.web]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"

[entryPoints.websecure]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "/etc/traefik/cert/traefik.crt"
keyFile = "/etc/traefik/cert/traefik.key"

[retry]
[[tls.certificates]]
certFile = "/etc/traefik/cert/traefik.crt"
keyFile = "/etc/traefik/cert/traefik.key"

[api]

[providers.docker]
endpoint = "unix:///var/run/docker.sock"

[log]
level = "ERROR"

[docker]
endpoint = "unix:///var/run/docker.sock"
watch = true
exposedByDefault = false

0 comments on commit 2484dbe

Please sign in to comment.