Deploying a Squid App
Introduction
Squid is a high-performance caching proxy supporting HTTP, HTTPS (CONNECT), and FTP. Deploying Squid with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage for cache and logs—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample connectivity checks.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your Squid Dockerfile and optional
squid.conf(GitHub is the only supported git source) - Clients that can point to a TCP proxy endpoint
For onboarding, see the Quick Start.
Architecture and ports
- Klutch.sh supports one port per app. Squid listens on TCP port
3128by default; choose TCP traffic and set the internal port to3128. - External clients connect to
example-app.klutch.sh:8000(Klutch TCP external) mapped to internal3128.
Repository layout
squid/├── Dockerfile # Must be at repo root for auto-detection└── squid.conf # Optional custom configurationKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Build and run locally:
docker build -t squid-local .docker run -p 3128:3128 squid-localTest with a proxy-aware client:
curl -x http://localhost:3128 https://example.comDockerfile for Squid (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM squid:latest
COPY squid.conf /etc/squid/squid.conf
EXPOSE 3128CMD ["squid", "-N", "-d", "1"]Notes:
- Pin to a specific tag (e.g.,
squid:6.5) for stability. - If you use the default config, remove the
COPY squid.confline.
Environment variables (Klutch.sh)
Squid primarily uses config files. If you rely on Nixpacks without the Dockerfile:
NIXPACKS_START_CMD=squid -N -d 1
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/spool/squid— cache storage./var/log/squid— logs.
Ensure the paths are writable inside the container.
Deploy Squid on Klutch.sh (Dockerfile workflow)
- Push your repository—with the Dockerfile (and optional
squid.conf) at the root—to GitHub. - Open klutch.sh/app, create a project, and add an app.
- Select TCP traffic and set the internal port to
3128. - Add any required environment variables (if used) and confirm your config is baked into the image.
- Attach volumes at
/var/spool/squidand/var/log/squidsized for your cache and logs. - Deploy. Point clients to
example-app.klutch.shon external port8000.
Sample checks
Verify the proxy responds:
curl -x http://example-app.klutch.sh:8000 https://www.google.com -ICheck access logs (if volumes attached and accessible):
kubectl exec <pod> -- tail -n 20 /var/log/squid/access.logHealth checks and production tips
- Use a TCP readiness probe against port
3128to confirm Squid accepts connections. - Tune cache size and ACLs in
squid.conf; keep sensitive ACL details in private repos or secrets. - Pin image versions and test config changes in staging before production rollout.
- Monitor cache and log volume usage; resize proactively.
Squid on Klutch.sh delivers a reproducible Docker proxy with managed storage—without extra YAML or CI steps. Configure ports, attach cache/log volumes, and direct clients to your TCP endpoint.