Public | Automated Build

Last pushed: 2 years ago
Short Description
Varnish docker image
Full Description

Varnish

Mounting

To mount this image, execute the following command inside this folder:

docker build -t varnish .

Serving

Just execute the following command line to execute varnish image on port 80:

docker run --name varnish -p 80:80 -d varnish

Specifying the Webserver

You can specify the webserver Varnish shall cache by set-up those two environments variables during the run process:

docker run --name varnish -p 80:80 --link nginx:nginx -e WEBSERVER=nginx -e WEBSERVER_PORT=8080 -d varnish

This example would expect that you have a running container of nginx and your servers configured on port 8080.

Using it with compose

An example of using nginx on port 8080 and varnish on 80

varnish:
    image: varnish
    ports:
        - 80:80
    environment:
        WEBSERVER: "nginx"
        WEBSERVER_PORT: "8080"
    links:
        - nginx
    volumes:
        - /path/to/your/www:/var/www

Logging

You can follow varnish container log by executing:

docker logs -f varnish
Docker Pull Command
Owner
alcmoraes
Source Repository