squidguard/Dockerfile

64 lines
1.8 KiB
Docker
Raw Normal View History

2022-07-09 13:26:28 -04:00
FROM casjaysdevdocker/debian:latest AS build
ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')"
LABEL \
org.label-schema.name="Full proxy server" \
org.label-schema.description="" \
2022-07-09 13:26:28 -04:00
org.label-schema.url="https://hub.docker.com/r/casjaysdevdocker/squid" \
org.label-schema.vcs-url="https://github.com/casjaysdevdocker/squid" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.version=$BUILD_DATE \
org.label-schema.vcs-ref=$BUILD_DATE \
2022-07-09 13:26:28 -04:00
org.label-schema.license="WTFPL" \
org.label-schema.vcs-type="Git" \
org.label-schema.schema-version="latest" \
org.label-schema.vendor="CasjaysDev" \
maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
ENV \
HOSTNAME=proxy \
SQUID_HOME_DIR=/var/lib/squid \
SQUID_CACHE_DIR=/data/cache/squid \
SQUID_LOG_DIR=/data/log/squid \
2022-02-16 19:05:38 -05:00
SQUID_USER=squid
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yy \
2022-02-16 17:39:21 -05:00
net-tools \
postfix \
apache2 \
apache2-bin \
libapache2-mod-fcgid \
libapache2-mod-geoip \
libapache2-mod-proxy-uwsgi \
libapache2-mod-fcgid \
libapache2-mod-wsgi-py3 \
2022-02-16 17:39:21 -05:00
squid \
squid-cgi \
squidclient \
e2guardian \
c-icap \
&& apt-get remove -yy --purge exim* \
2022-02-16 14:38:34 -05:00
&& rm -rf /var/lib/apt/lists/* /etc/apache2/* \
&& mkdir -p /config /data \
2022-02-16 14:38:34 -05:00
&& { grep -qs "$SQUID_USER" /etc/passwd || useradd -d "$SQUID_HOME_DIR" -r -U -m "$SQUID_USER"; } \
&& chown -R "$SQUID_USER":"$SQUID_USER" "/config" "/data"
ADD ./config/. /etc/
ADD ./bin/. /usr/local/bin/
ADD ./data/. /usr/local/share/squidFiles/data/
ADD ./config/. /usr/local/share/squidFiles/config/
FROM scratch
COPY --from=build /. /
2022-02-16 17:39:21 -05:00
EXPOSE 3128 8080
2022-02-16 17:40:29 -05:00
WORKDIR /config
VOLUME ["/config", "/data"]
2022-02-16 19:05:38 -05:00
HEALTHCHECK --start-period=1m --interval=10m --timeout=3s CMD ["/usr/local/bin/entrypoint-squid.sh","healthcheck"]
ENTRYPOINT ["/usr/local/bin/entrypoint-squid.sh"]