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

What if i need to run using docker-compose #9

Open
iskyd opened this issue Feb 19, 2016 · 1 comment
Open

What if i need to run using docker-compose #9

iskyd opened this issue Feb 19, 2016 · 1 comment

Comments

@iskyd
Copy link

iskyd commented Feb 19, 2016

Is there a way to run it without specify -i and so run varnish in foreground?
This is a problem if you're using docker-compose i suppose.
I think that something like that (in start.sh)

exec bash -c "exec varnishd -F -f /etc/varnish/default.vcl -s malloc,100M -a 0.0.0.0:${VARNISH_PORT}"

could work.

@oskapt
Copy link

oskapt commented Jul 20, 2016

Old issue/question, but here's an answer:

You don't need to change the command if running from Compose. Just have compose start the container:

data:
  image: busybox
  volumes:
    - /opt/docker/varnish/var:/var/lib/varnish
    - /opt/docker/varnish/etc:/etc/varnish
varnish:
  image: yourname/varnish
  volumes_from:
    - data
  ports:
    - "8000:80"
  environment:
    VARNISH_PORT: 80
    VARNISH_BACKEND_IP: 1.2.3.4
    VARNISH_BACKEND_PORT: 80

The included start.sh runs varnish (which goes into the background) and then runs varnishlog as the foreground process. This allows you to get logs from varnish by using docker logs or docker-compose logs (though the latter lacks options for tail and follow and will blast your screen with more data than you can process).

This is not an issue and should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants