Skip to content

Instantly share code, notes, and snippets.

@piotrkwiecinski
Created May 15, 2024 13:22
Show Gist options
  • Save piotrkwiecinski/2e277f220e842a9151331216f2e70fbb to your computer and use it in GitHub Desktop.
Save piotrkwiecinski/2e277f220e842a9151331216f2e70fbb to your computer and use it in GitHub Desktop.
Docker traefik
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:
#!/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