-
Notifications
You must be signed in to change notification settings - Fork 50
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
Added fully configured Docker image #83
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!