1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 17:56:53 +02:00

update squid

This commit is contained in:
kev 2021-10-15 15:13:46 +08:00
parent 6a006e6815
commit 36d5b1dc81
3 changed files with 14 additions and 8 deletions

View File

@ -20,6 +20,7 @@ services:
- "3128:3128/tcp"
- "3130:3130/udp"
volumes:
- ./data/etc/squid.conf:/etc/squid/squid.conf
- ./data/cache:/var/cache/squid
- ./data/log:/var/log/squid
stop_signal: SIGKILL
@ -27,13 +28,15 @@ services:
```
> You can mount custom config file as `/etc/squid/squid.conf`.
>> You need to run `squid -z` when `cache_dir ufs` is enabled.
## Up and Running
```bash
# server
$ mkdir -p data/{cache,log}
$ mkdir -p data/{etc,cache,log}
$ chmod -R 777 data
$ docker-compose run --rm squid squid -z
$ docker-compose up -d
# client

View File

@ -5,11 +5,14 @@
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
acl Safe_ports port 80 # http
@ -22,7 +25,6 @@ acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
#
# Recommended minimum Access Permission configuration:
@ -59,7 +61,7 @@ http_access deny all
http_port 3128
# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/cache/squid 100 16 256
cache_dir ufs /var/cache/squid 100 16 256
# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

View File

@ -6,6 +6,7 @@ services:
- "3128:3128/tcp"
- "3130:3130/udp"
volumes:
- ./data/etc/squid.conf:/etc/squid/squid.conf
- ./data/cache:/var/cache/squid
- ./data/log:/var/log/squid
stop_signal: SIGKILL