-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Traefik proxy (#189)
* Add template for Traefik * Use Docker client for version detection * Add proxy labels support for template config file * Add tests for EvaluateProjectLabels * Fix typo in Traefik service file * Select correct dependency versions * Fix bug * Fix https redirect * Fix entrypoints * Optimize template * Fix Jwilder proxy variables * Fix bug with letsencrypt tls helper * Fix typo in README
- Loading branch information
1 parent
223cacc
commit 7f28dbc
Showing
49 changed files
with
592 additions
and
215 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
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
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 @@ | ||
## Traefik Reverse Proxy | ||
Traefik is an open-source edge router that supports automatic service detection/exposure and fully-automated TLS certificate issuing/renewal. Thus, it can be used as single-service reverse proxy without a TLS helper service. |
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,103 @@ | ||
{ | ||
"label": "Traefik Proxy", | ||
"preselected": "false", | ||
"proxied": true, | ||
"files": [ | ||
{ | ||
"path": "service.yml", | ||
"type": "service" | ||
}, | ||
{ | ||
"path": "README.md", | ||
"type": "docs" | ||
}, | ||
{ | ||
"path": "./volumes/traefik-proxy-config/traefik.yml", | ||
"type": "config" | ||
} | ||
], | ||
"questions": [ | ||
{ | ||
"text": "Default virtual domain (e.g. example.com):", | ||
"type": 2, | ||
"validator": "hostname", | ||
"variable": "TRAEFIK_DEFAULT_HOST" | ||
}, | ||
{ | ||
"text": "Default email address:", | ||
"defaultValue": "webmaster@${{TRAEFIK_DEFAULT_HOST}}", | ||
"type": 2, | ||
"validator": "email", | ||
"variable": "TRAEFIK_DEFAULT_EMAIL" | ||
}, | ||
{ | ||
"text": "Which version of of Traefik Proxy do you want to use?", | ||
"defaultValue": "2.5.3", | ||
"type": 2, | ||
"variable": "TRAEFIK_PROXY_VERSION", | ||
"advanced": true | ||
}, | ||
{ | ||
"text": "Which port do you want to use for HTTP?", | ||
"defaultValue": "80", | ||
"type": 2, | ||
"validator": "port", | ||
"variable": "TRAEFIK_PROXY_HTTP_PORT", | ||
"advanced": true | ||
}, | ||
{ | ||
"text": "Which port do you want to use for HTTPS?", | ||
"defaultValue": "443", | ||
"type": 2, | ||
"validator": "port", | ||
"variable": "TRAEFIK_PROXY_HTTPS_PORT", | ||
"advanced": true | ||
}, | ||
{ | ||
"text": "Which port do you want to use for the Traefik web interface?", | ||
"defaultValue": "8080", | ||
"type": 2, | ||
"validator": "port", | ||
"variable": "TRAEFIK_PROXY_INTERFACE_PORT" | ||
} | ||
], | ||
"proxy-questions": [ | ||
{ | ||
"text": "Virtual domain:", | ||
"defaultValue": "${{CURRENT_SERVICE_NAME}}.${{TRAEFIK_DEFAULT_HOST}}", | ||
"type": 2, | ||
"validator": "hostname", | ||
"variable": "TRAEFIK_VIRTUAL_HOST" | ||
} | ||
], | ||
"proxy-labels": [ | ||
{ | ||
"name": "traefik.enable", | ||
"value": "true", | ||
"condition": "true" | ||
}, | ||
{ | ||
"name": "traefik.http.routers.${{CURRENT_SERVICE_NAME}}.rule", | ||
"value": "Host(`${{TRAEFIK_VIRTUAL_HOST}}`)", | ||
"condition": "true" | ||
}, | ||
{ | ||
"name": "traefik.http.routers.${{CURRENT_SERVICE_NAME}}.tls", | ||
"value": "true", | ||
"condition": "true" | ||
}, | ||
{ | ||
"name": "traefik.http.routers.${{CURRENT_SERVICE_NAME}}.tls.certresolver", | ||
"value": "letsEncrypt", | ||
"condition": "true" | ||
} | ||
], | ||
"volumes": [ | ||
{ | ||
"text": "Custom path for proxy config volume?", | ||
"defaultValue": "./volumes/traefik-proxy-config", | ||
"variable": "VOLUME_TRAEFIK_PROXY_CONFIG", | ||
"advanced": 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
image: traefik:v${{TRAEFIK_PROXY_VERSION}} | ||
container_name: ${{PROJECT_NAME_CONTAINER}}-proxy-traefik | ||
restart: always | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ${{VOLUME_TRAEFIK_PROXY_CONFIG}}:/etc/traefik:ro | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
- ${{TRAEFIK_PROXY_INTERFACE_PORT}}:8080 | ||
profiles: | ||
- prod | ||
command: --providers.docker |
29 changes: 29 additions & 0 deletions
29
predefined-services/proxy/traefik/volumes/traefik-proxy-config/traefik.yml
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,29 @@ | ||
providers: | ||
docker: | ||
endpoint: "unix:///var/run/docker.sock" | ||
exposedByDefault: false | ||
watch: true | ||
|
||
api: | ||
dashboard: true | ||
|
||
entryPoints: | ||
http: | ||
address: ":80" | ||
http: | ||
redirections: | ||
entryPoint: | ||
to: "https" | ||
scheme: "https" | ||
https: | ||
address: ":443" | ||
|
||
certificatesResolvers: | ||
letsEncrypt: | ||
acme: | ||
email: ${{TRAEFIK_DEFAULT_EMAIL}} | ||
storage: acme.json | ||
tlsChallenge: {} | ||
|
||
global: | ||
checkNewVersion: 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
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
Oops, something went wrong.