From 12f32413b2685eef6978f786fcf780733e8762c8 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 17 Jul 2021 11:19:43 +0100 Subject: [PATCH] Add post [ci skip] --- .../using-traefik-local-proxy-sculpin.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 source/_posts/using-traefik-local-proxy-sculpin.md diff --git a/source/_posts/using-traefik-local-proxy-sculpin.md b/source/_posts/using-traefik-local-proxy-sculpin.md new file mode 100644 index 00000000..53cafa1f --- /dev/null +++ b/source/_posts/using-traefik-local-proxy-sculpin.md @@ -0,0 +1,63 @@ +--- +title: Using Traefik as a local proxy with Sculpin +tags: + - docker + - sculpin +draft: true +--- + + + +## Before + +```yaml +services: + app: + build: + context: . + dockerfile: tools/docker/images/Dockerfile + target: app + volumes: + - assets:/app/source/build + - /app/output_dev + - .:/app + ports: + - 8000:8000 +``` + +## Adding the proxy service + +```yaml +services: + proxy: + image: traefik:v2.0-alpine + command: + - --api.insecure=true + - --providers.docker + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - 80:80 + - 8080:8080 + labels: + - "traefik.enable=false" +``` + +## Updating the app service + +```yaml +app: + build: + context: . + dockerfile: tools/docker/images/Dockerfile + target: app + expose: + - 80 + command: [generate, --server, --watch, --port, '80', --url, http://oliverdavies.localhost] + volumes: + - assets:/app/source/build + - /app/output_dev + - .:/app + labels: + - "traefik.http.routers.oliverdavies.rule=Host(`oliverdavies.localhost`)" +```