--- 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`)" ```