Merge pull request #1519 from gquintard/add/varnish

Add/varnish
This commit is contained in:
Tianon Gravi 2019-07-03 16:25:06 -07:00 committed by GitHub
commit 2d3a7234a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 0 deletions

1
varnish/README-short.txt Normal file
View File

@ -0,0 +1 @@
Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs.

49
varnish/content.md Normal file
View File

@ -0,0 +1,49 @@
# What is Varnish?
Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers that often support FTP, SMTP and other network protocols.
> [wikipedia.org/wiki/Varnish_(software)](https://en.wikipedia.org/wiki/Varnish_(software))
%%LOGO%%
# How to use this image.
## Basic usage
Create a `default.vcl` file:
```vcl
vcl 4.0;
backend default {
.host = "www.nytimes.com:80";
}
```
Then run:
```console
$ docker run --name my-running-varnish -v /path/to/default.vcl:/etc/varnish/default.vcl:ro --tmpfs /usr/local/var/varnish:exec -d %%IMAGE%%
```
Alternatively, a simple `Dockerfile` can be used to generate a new image that includes the necessary `default.vcl` (which is a much cleaner solution than the bind mount above):
```dockerfile
FROM %%IMAGE%%:6.2
COPY default.vcl /etc/varnish/
```
Place this file in the same directory as your `default.vcl`, run `docker build -t my-varnish .`, then start your container:
```console
$ docker run --name my-running-varnish --tmpfs /var/lib/varnish:exec -d my-varnish
```
### Exposing the port
```console
$ docker run --name my-running-varnish --tmpfs /usr/local/var/varnish:exec -d -p 8080:80 my-varnish
```
Then you can hit `http://localhost:8080` or `http://host-ip:8080` in your browser.

1
varnish/github-repo Normal file
View File

@ -0,0 +1 @@
https://github.com/varnish/docker-varnish

1
varnish/license.md Normal file
View File

@ -0,0 +1 @@
View [license information](https://github.com/varnishcache/varnish-cache/blob/master/LICENSE) for the software contained in this image.

BIN
varnish/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

1
varnish/maintainer.md Normal file
View File

@ -0,0 +1 @@
[the Varnish Docker Community](%%GITHUB-REPO%%)