Created
October 13, 2024 23:29
-
-
Save Curt-Park/91c81d8adb11cc5a25a4c2796a131fab to your computer and use it in GitHub Desktop.
tinyproxy web service docker compose example
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
--- | |
volumes: | |
traefik: {} | |
services: | |
traefik: | |
image: traefik:v3.1.2 | |
container_name: traefik | |
command: | |
- --log.level=INFO | |
- --providers.docker=true | |
- --api.insecure=true | |
- --api.dashboard=true | |
- --accesslog=true | |
- --entryPoints.web.address=:80 | |
- --entryPoints.websecure.address=:443 | |
ports: | |
# The HTTP port | |
- 80:80 | |
# The HTTPS port | |
- 443:443 | |
# The traefik dashboard port | |
- 8080:8080 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- traefik:/traefik_vol | |
restart: always | |
service-proxy: | |
image: docker.io/kalaksi/tinyproxy:latest | |
container_name: service-proxy | |
labels: | |
- traefik.enable=true | |
- traefik.http.routers.service.entrypoints=web | |
- traefik.http.routers.service.rule=PathPrefix(`/service`) | |
- traefik.http.services.service.loadbalancer.server.port=5000 | |
- traefik.http.middlewares.service-pathstrip.stripprefix.prefixes=/service | |
- traefik.http.routers.service.middlewares=service-pathstrip@docker | |
entrypoint: /bin/sh | |
command: > | |
-c "echo \"$$CONFIG\" > /etc/tinyproxy/tinyproxy.conf && | |
tinyproxy -d -c /etc/tinyproxy/tinyproxy.conf" | |
# See tinyproxy.conf for better explanation of these values. | |
# https://tinyproxy.github.io/ | |
environment: | |
CONFIG: | | |
Port 5000 | |
LogLevel Info | |
Timeout 600 | |
ReversePath "/" "http://service-host-address:5000/" | |
restart: always |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment