Skip to content

Commit

Permalink
[Docker] Minor fixes in Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Aug 18, 2017
1 parent 50fc10e commit 0b80a32
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion doc/docker/Dockerfile-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN composer run-script post-install-cmd --no-interaction

# Copy over just the files we want in second stage, so resulting stage only has assets
# and vhost config in as few layers as possible
FROM nginx:stable-alpine as web-multilayers
FROM nginx:stable as web-multilayers

COPY bin/vhost.sh /var/www/bin/vhost.sh
COPY doc/nginx/vhost.template /var/www/doc/nginx/vhost.template
Expand All @@ -38,3 +38,6 @@ COPY --from=web-multilayers /var/www /var/www
COPY doc/nginx/ez_params.d /etc/nginx/ez_params.d

CMD /bin/bash -c "cd /var/www && bin/vhost.sh --template-file=doc/nginx/vhost.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"

# Attempt to force varnish to not start before this service has started, proper healtcheck should check if nginx gives 200 reply on static (self served) url
HEALTHCHECK --start-period=1s CMD exit 0
5 changes: 3 additions & 2 deletions doc/docker/Dockerfile-varnish
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ENV DEBIAN_FRONTEND noninteractive

# Use packages from Varnish to get Varnsih 5.1, 5.0 packages with debian:stretch gives segmentation faults
RUN apt-get update -q -y && \
apt-get install -q -y --force-yes --no-install-recommends ca-certificates curl && \
apt-get install -q -y --no-install-recommends ca-certificates curl && \
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash && \
apt-get install -q -y --force-yes --no-install-recommends varnish
apt-get install -q -y --allow-unauthenticated --no-install-recommends varnish && \
rm -rf /var/lib/apt/lists/*

COPY doc/varnish/vcl/varnish4.vcl /etc/varnish/default.vcl
COPY doc/docker/entrypoint/varnish/parameters.vcl /etc/varnish/parameters.vcl
Expand Down
2 changes: 1 addition & 1 deletion doc/docker/entrypoint/varnish/parameters.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

backend ezplatform {
.host = "web";
.port = "80";
.port = "8080";
}

// ACL for invalidators IP
Expand Down
4 changes: 4 additions & 0 deletions doc/docker/varnish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ services:
- "8081:80"
depends_on:
- web
- app
networks:
- frontend
- backend


## DEBUG??
Expand Down

0 comments on commit 0b80a32

Please sign in to comment.