1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-29 18:21:24 +00:00
dockerfiles/squid/README.md

47 lines
1.1 KiB
Markdown
Raw Normal View History

2016-04-03 02:13:05 +00:00
squid
=====
![](https://badge.imagelayers.io/vimagick/squid:latest.svg)
[Squid][1] is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and
more. It reduces bandwidth and improves response times by caching and reusing
frequently-requested web pages. Squid has extensive access controls and makes a
great server accelerator. It runs on most available operating systems,
including Windows and is licensed under the GNU GPL.
## docker-compose.yml
```yaml
2021-10-14 03:51:55 +00:00
version: "3.8"
services:
squid:
image: vimagick/squid
ports:
- "3128:3128/tcp"
- "3130:3130/udp"
volumes:
2021-10-15 07:13:46 +00:00
- ./data/etc/squid.conf:/etc/squid/squid.conf
2021-10-14 03:51:55 +00:00
- ./data/cache:/var/cache/squid
- ./data/log:/var/log/squid
stop_signal: SIGKILL
restart: unless-stopped
2016-04-03 02:13:05 +00:00
```
2021-10-14 03:51:55 +00:00
> You can mount custom config file as `/etc/squid/squid.conf`.
2021-10-15 07:13:46 +00:00
>> You need to run `squid -z` when `cache_dir ufs` is enabled.
2016-04-05 05:10:51 +00:00
2016-04-03 02:13:05 +00:00
## Up and Running
2020-04-23 07:07:52 +00:00
```bash
2016-04-03 02:13:05 +00:00
# server
2021-10-15 07:13:46 +00:00
$ mkdir -p data/{etc,cache,log}
2021-10-14 03:51:55 +00:00
$ chmod -R 777 data
2021-10-15 07:13:46 +00:00
$ docker-compose run --rm squid squid -z
2016-04-03 02:13:05 +00:00
$ docker-compose up -d
# client
2021-10-14 03:51:55 +00:00
$ curl -x 127.0.0.1:3128 ifconfig.co
2016-04-03 02:13:05 +00:00
```
[1]: http://www.squid-cache.org/