-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-27788: Update and cleanup docker config for Docker 17.06 features (…
…#192) * [Docker] Update to Docker 17.06 & improve Mac performance with :cached Now that Docker 17.06 stable release is out, `:cached` and other features are now available in stable versions and can be used (17.04/5: edge). Bumps compose version all the way up to 3.3 which came in 17.06 for future use and hopefully not having to bump in in a while. * [Docker] Use healtcheck images for mariadb and redis Should theoretically get rid of the issue where app image starts up before mariadb is ready for connections, leading to user reaching 500 page. Note: The previous commit adding cached mounts for the sql file mostly fixes the issue, but this commit should in theory avoid app contianer starting to early. * [Docker] Add prod image for nginx Based on code from ezsystems/ezplatform-ee-demo#33 * [Docker] Update Varnish to use stretch & build config into image * [Travis] Use Docker Compose 1.14 and Docker 17.06 * [Docker] Rename folder to doc/docker now that it contains more then just compose files As a bonus this also shorten the paths when working with the files. * [Docker] Swithc to dev by default now that we have :cached folders * [Doc] Update doc to better reflect what the bundled docker blueprints are for Aslo rather add links to Launchpad for people wanting to get up and running easily. * [Docker] Minor fixes in Dockerfiles * [Docker] Add env variable for malloc size
- Loading branch information
Showing
23 changed files
with
162 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ web/bundles/ | |
web/css/ | ||
web/js/ | ||
web/uploads/ | ||
web/fonts/ | ||
|
||
# Assets managed by Bower | ||
web/assets/vendor/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ezsystems/php:7.1-v1 as web-build | ||
|
||
ENV SYMFONY_ENV=prod | ||
|
||
# Copy in project files into work dir | ||
COPY . /var/www | ||
|
||
# Create asset directories that might not exists | ||
RUN if [ ! -d /var/www/web/fonts ]; then mkdir /var/www/web/fonts; fi | ||
RUN if [ ! -d /var/www/web/assets ]; then mkdir /var/www/web/assets; fi | ||
|
||
# Generate assets using hard copy as we need to copy them over to resulting image | ||
RUN composer config extra.symfony-assets-install hard | ||
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 as web-multilayers | ||
|
||
COPY bin/vhost.sh /var/www/bin/vhost.sh | ||
COPY doc/nginx/vhost.template /var/www/doc/nginx/vhost.template | ||
|
||
# Auto generated assets | ||
COPY --from=web-build /var/www/web/bundles /var/www/web/bundles | ||
COPY --from=web-build /var/www/web/css /var/www/web/css | ||
COPY --from=web-build /var/www/web/fonts /var/www/web/fonts | ||
COPY --from=web-build /var/www/web/js /var/www/web/js | ||
|
||
# User provided assets | ||
COPY --from=web-build /var/www/web/assets /var/www/web/assets | ||
|
||
|
||
# In third stage build the resulting image | ||
FROM nginx:stable | ||
|
||
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;'" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM debian:stretch-slim | ||
|
||
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 --no-install-recommends ca-certificates curl && \ | ||
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash && \ | ||
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 | ||
|
||
ENV VARNISH_MALLOC_SIZE="256M" | ||
|
||
EXPOSE 80 6082 | ||
|
||
# CMD in shell form to be able to use env variables here | ||
CMD varnishd -F -a :80 -T :6082 -f /etc/varnish/default.vcl -s malloc,${VARNISH_MALLOC_SIZE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.