|
|
|
|
|
FROM ubuntu:24.04 |
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
|
|
|
RUN apt-get update && \ |
|
|
apt-get install -y squid sudo && \ |
|
|
apt-get clean && \ |
|
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
|
|
|
RUN echo 'cache_dir ufs /tmp 100 16 256\n\ |
|
|
http_port 7860\n\ |
|
|
pid_filename /tmp/squid.pid\n\ |
|
|
cache_mem 128 MB\n\ |
|
|
maximum_object_size 4096 KB\n\ |
|
|
cache_swap_high 95\n\ |
|
|
cache_swap_low 90\n\ |
|
|
forwarded_for delete\n\ |
|
|
via off\n\ |
|
|
follow_x_forwarded_for deny all\n\ |
|
|
request_header_access X-Forwarded-For deny all\n\ |
|
|
request_header_access Via deny all\n\ |
|
|
visible_hostname squid-proxy-hf\n\ |
|
|
acl SSL_ports port 443\n\ |
|
|
acl Safe_ports port 80\n\ |
|
|
acl Safe_ports port 443\n\ |
|
|
acl CONNECT method CONNECT\n\ |
|
|
http_access allow all\n\ |
|
|
http_access deny !Safe_ports\n\ |
|
|
http_access deny CONNECT !SSL_ports\n\ |
|
|
http_access deny all\n\ |
|
|
access_log stdio:/dev/stdout\n\ |
|
|
cache_log stdio:/dev/stderr\n\ |
|
|
cache_store_log stdio:/dev/stdout\n\ |
|
|
refresh_pattern ^ftp: 1440 20% 10080\n\ |
|
|
refresh_pattern ^gopher: 1440 0% 1440\n\ |
|
|
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0\n\ |
|
|
refresh_pattern . 0 20% 4320\n\ |
|
|
pipeline_prefetch 1\n\ |
|
|
half_closed_clients off' > /etc/squid/squid.conf |
|
|
|
|
|
|
|
|
RUN chown root:proxy /etc/squid/squid.conf && \ |
|
|
chmod 644 /etc/squid/squid.conf |
|
|
|
|
|
|
|
|
|
|
|
RUN sudo -u proxy squid -z |
|
|
|
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
|
|
CMD squid -k check |
|
|
|
|
|
USER proxy |
|
|
|
|
|
|
|
|
CMD ["squid", "-NYC"] |
|
|
|