Created
May 15, 2024 13:22
-
-
Save piotrkwiecinski/2e277f220e842a9151331216f2e70fbb to your computer and use it in GitHub Desktop.
Docker 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
services: | |
app: | |
ports: !reset [] | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.magento-loc.tls=true" | |
- "traefik.http.routers.magento-loc.rule=Host(`magento.loc`)" | |
- "traefik.http.services.magento-loc.loadbalancer.server.port=8443" | |
- "traefik.http.services.magento-loc.loadbalancer.server.scheme=https" | |
networks: | |
local-dev-proxy: | |
mailcatcher: | |
ports: !reset [] | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.magento-loc-mailcacher.tls=true" | |
- "traefik.http.routers.magento-loc-mailcacher.rule=Host(`mail.magento.loc`)" | |
- "traefik.http.services.magento-loc-mailcacher.loadbalancer.server.port=1080" | |
- "traefik.http.services.magento-loc-mailcacher.loadbalancer.server.scheme=http" | |
networks: | |
local-dev-proxy: |
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
#!/bin/bash | |
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
if docker compose version > /dev/null 2>&1; then | |
DOCKER_COMPOSE="docker compose" | |
else | |
DOCKER_COMPOSE="docker-compose" | |
fi | |
COMPOSE_FILES=("compose.yaml" "compose.traefik.yaml") | |
if [ "$1" == "--no-dev" ]; then | |
shift 1 | |
else | |
COMPOSE_FILES+=("compose.dev.yaml") | |
fi | |
COMPOSE_FILES_PREFIXED=() | |
for file in "${COMPOSE_FILES[@]}"; do | |
COMPOSE_FILES_PREFIXED+=("-f" "${__dir}/../$file") | |
done | |
${DOCKER_COMPOSE} "${COMPOSE_FILES_PREFIXED[@]}" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment