-
Notifications
You must be signed in to change notification settings - Fork 178
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 #548 from thekondor/423__envfile-cli-support
Support `--envfile` CLI argument
- Loading branch information
Showing
10 changed files
with
158 additions
and
79 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,6 @@ | ||
service.local { | ||
handle {$ENV_HANDLE_PATH} { | ||
respond "Hello from TestEnv" | ||
} | ||
tls internal | ||
} |
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 @@ | ||
ENV_HANDLE_PATH=/testenv |
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,31 @@ | ||
version: '3.7' | ||
|
||
services: | ||
caddy: | ||
image: caddy-docker-proxy:local | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
networks: | ||
- caddy | ||
environment: | ||
- CADDY_DOCKER_CADDYFILE_PATH=/etc/caddy/Caddyfile | ||
command: ["docker-proxy", "--envfile", "/etc/caddy/env"] | ||
volumes: | ||
- source: "./Caddyfile" | ||
target: '/etc/caddy/Caddyfile' | ||
type: bind | ||
- source: "./Envfile" | ||
target: "/etc/caddy/env" | ||
type: bind | ||
- source: "${DOCKER_SOCKET_PATH}" | ||
target: "${DOCKER_SOCKET_PATH}" | ||
type: ${DOCKER_SOCKET_TYPE} | ||
|
||
networks: | ||
caddy: | ||
name: caddy_test | ||
external: true | ||
internal: | ||
name: internal | ||
internal: 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,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
. ../functions.sh | ||
|
||
docker stack deploy -c compose.yaml --prune caddy_test | ||
|
||
retry curl --show-error -s -k -f --resolve service.local:443:127.0.0.1 https://service.local/testenv | grep "Hello from TestEnv" || { | ||
docker service logs caddy_test_caddy | ||
exit 1 | ||
} |