-
Notifications
You must be signed in to change notification settings - Fork 23
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
Dockerfile converted into multistage #295
Conversation
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.
These changes looks good to go.
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.
While enhancing native Dockerfiles to use to build docker images for devstack, we have set some standards which we want to replicate in cookiecutter here. From those standards was the use of virtualenv
to install python requirements. We also need to set up virtualenv
here so we have consistency among IDAs.
|
||
RUN mkdir -p /edx/var/log | ||
# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. |
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.
This comment isn't relevant here.
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.
removed
|
||
# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. | ||
CMD gunicorn --workers=2 --name {{cookiecutter.repo_name}} -c /edx/app/{{cookiecutter.repo_name}}/{{cookiecutter.project_name}}/docker_gunicorn_configuration.py --log-file - --max-requests=1000 {{cookiecutter.project_name}}.wsgi:application | ||
|
||
# This line is after the requirements so that changes to the code will not | ||
# bust the image cache | ||
COPY . /edx/app/{{cookiecutter.repo_name}} | ||
COPY . /edx/app/{{cookiecutter.repo_name}} |
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.
Add an empty line at the end of the file.
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.
added
|
||
RUN mkdir -p /edx/var/log | ||
# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. | ||
CMD while true; do python ./manage.py runserver 0.0.0.0:8120; sleep 2; done |
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.
Instead of hardcoding the port, use cookie-cutter input {{cookiecutter.port}}
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.
done
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.
While enhancing native Dockerfiles to use to build docker images for devstack, we have set some standards which we want to replicate in cookiecutter here. From those standards was the use of
virtualenv
to install python requirements. We also need to set upvirtualenv
here so we have consistency among IDAs.
Thanks @iamsobanjaved for the suggestion. I've added virtual environment and tested its successful docker image build on local.
Closing this PR as an other PR has already been merged which is doing the same. |
Description:
Added two stages dev and prod target in Dockerfile.
Steps to test
cookiecutter -o /path/to/folder/for/creating/project cookiecutter-django-ida
make upgrade
to prepare requirements filesmake docker_build
to make test image buildIssue:
#292
Merge checklist: