Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to alpine 3.3 and squad 3.5.15-r1. #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.2
FROM alpine:3.3

MAINTAINER chrisdaish@gmail.com
MAINTAINER simon.perkins@gmail.com

RUN apk update \
&& apk add squid=3.5.4-r2 \
&& apk add squid=3.5.15-r1 \
&& apk add curl \
&& rm -rf /var/cache/apk/*

Expand Down
58 changes: 51 additions & 7 deletions configFiles/squid.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,54 @@ http_port 3128
# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
# Everything up until refresh_all_ims taken from
# https://tails.boum.org/contribute/build/squid-deb-proxy/squid-deb-proxy.conf
cache_replacement_policy heap LFUDA

# refresh patterns
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern deb$ 129600 100% 129600
refresh_pattern udeb$ 129600 100% 129600
refresh_pattern tar.gz$ 129600 100% 129600
refresh_pattern DiffIndex$ 0 20% 4320 refresh-ims
refresh_pattern PackagesIndex$ 0 20% 4320 refresh-ims
refresh_pattern Packages\.bz2$ 0 20% 4320 refresh-ims
refresh_pattern Packages\.gz$ 0 20% 4320 refresh-ims
refresh_pattern Packages\.lzma$ 0 20% 4320 refresh-ims
refresh_pattern SourcesIndex$ 0 20% 4320 refresh-ims
refresh_pattern Sources\.bz2$ 0 20% 4320 refresh-ims
refresh_pattern Sources\.gz$ 0 20% 4320 refresh-ims
refresh_pattern Sources\.lzma$ 0 20% 4320 refresh-ims
refresh_pattern Release$ 0 20% 4320 refresh-ims
refresh_pattern Release\.gpg$ 0 20% 4320 refresh-ims
refresh_pattern Translation-en\.bzip2$ 0 20% 4320 refresh-ims
refresh_pattern Translation-en\.bz2$ 0 20% 4320 refresh-ims
refresh_pattern Translation-en\.gz$ 0 20% 4320 refresh-ims
refresh_pattern Translation-en\.lzma$ 0 20% 4320 refresh-ims
refresh_pattern Translation-fr\.bzip2$ 0 20% 4320 refresh-ims
refresh_pattern Translation-fr\.bz2$ 0 20% 4320 refresh-ims
refresh_pattern Translation-fr\.gz$ 0 20% 4320 refresh-ims
refresh_pattern Translation-fr\.lzma$ 0 20% 4320 refresh-ims
refresh_pattern . 0 20% 4320

# handle meta-release and changelogs.ubuntu.com special
refresh_pattern changelogs.ubuntu.com/* 0 1% 1

# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499379
refresh_all_ims on

cache_effective_user squid
cache_effective_group squid

# Based on the following web page
# http://flavioleitner.blogspot.co.za/2014/03/squid-is-not-caching-files-with-size.html
# cache_dir needs to be placed after all the other directives otherwise
# they don't get applied
cache_mem 32 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 4 GB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/cache/squid 16384 16 256
Empty file.
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
squid:
image: sperkins/squid:3.5.15-r1
ports:
- "3128:3128"
volumes:
- ./configFiles/squid.conf:/etc/squid/squid.conf:ro
- /srv/docker/squid/cache:/var/cache/squid:rw
- /srv/docker/squid/log:/var/log/squid:rw
- /etc/localtime:/etc/localtime:ro
restart: always
4 changes: 4 additions & 0 deletions start-squid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ set -e
CHOWN=$(/usr/bin/which chown)
SQUID=$(/usr/bin/which squid)

# Ensure that the squid spool directory exists
mkdir -p /var/spool/squid

# Ensure permissions are set correctly on the Squid cache + log dir.
"$CHOWN" -R squid:squid /var/cache/squid
"$CHOWN" -R squid:squid /var/log/squid
"$CHOWN" -R squid:squid /var/spool/squid

# Prepare the cache using Squid.
echo "Initializing cache..."
Expand Down