Added fully configured Docker image#83
Conversation
|
This is a fantastic idea, thank you for submitting the PR and doing all the leg work. I'll take a look at getting this done for the next release. Thanks for using Packages! |
| @@ -0,0 +1,42 @@ | |||
| FROM composer | |||
There was a problem hiding this comment.
Composer is already included in webdevops/php-nginx:7.2 and updated on every image build.
| ENV WEB_DOCUMENT_ROOT=/app/web | ||
| ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
|
|
||
| ENV PACKAGES_NAME='Terramar Labs' |
There was a problem hiding this comment.
To keep the amount of image layers as small as possible, you should use:
ENV FOO='Bar' \
BAR='Baz'
|
|
||
| COPY --from=0 /usr/bin/composer /usr/bin/composer | ||
|
|
||
| RUN apt-get update \ |
There was a problem hiding this comment.
The webdevops image contains a helpful wrapper apt-install gettext-base procps which updates, installs and cleans afterwards.
|
|
||
| COPY . /app | ||
| COPY ./docker/nginx/vhost.common.d/vhost.common.conf /opt/docker/etc/nginx/vhost.common.d/10-location-root.conf | ||
| RUN chown -R 1000:1000 /app |
There was a problem hiding this comment.
Reduce number of image layers also here by executing concatenated RUN commands
| && ssh-keyscan -t rsa bitbucket.org >> /root/.ssh/known_hosts \ | ||
| && ssh-keyscan -t rsa gitlab.com >> /root/.ssh/known_hosts | ||
|
|
||
| ENTRYPOINT envsubst < config.yml.tmpl > config.yml \ |
There was a problem hiding this comment.
You should add a supervisord service for the resque worker and there's also a mechanism for doing startup commands in the docker container: service.d scripts.
Hey there,
the previous Docker support didn't quite adhere to Docker principles and made Packages sort of painful to setup on production. I've rewritten the Docker files to generate fully configured instance of the application that can easily be deployed.
You can see the results here: https://hub.docker.com/r/mkerix/packages/
Important tasks after merging
webdevops/php-nginx.Please let me know if you have any questions!