-
Notifications
You must be signed in to change notification settings - Fork 4
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
Dockerize #47
Dockerize #47
Conversation
Merge master back to dockerize branch to sync back up
I see this error message:
However, when I run outside of Docker container:
I see Swagger pages at Things I checked:
I am not sure why I get the error when running docker-compose. I will look at it more tonight. |
Thanks @jimtyhurst. I have seen that same error in other testing but I was unable to reproduce it with the clone of the repo I did just before the PR, so I figured I must have finally flushed it out. However, I sync'd my fork (mikethecanuck/team-budget) with the main project (hackoregon/team-budget) and tried the The most informative article I can find referencing that error is this one on StackOverflow, but I can't see how the virtualenv would have any impact inside the container (as you observed): |
OK, I figured it out. This has to do with the /budget_proj/requirements.txt file (which I'd abandoned as did some of you, thinking it was redundant). As with the /Data/folder, Docker can't access /requirements.txt (which at time of writing included the I'll update these in the PR here later on if someone else doesn't get to it first. (I'm on the road at the moment so I won't have access to a computer for a while - and editing these files on a phone is a mite dangerous.) |
Missing dependencies in /budget_proj/requirements.txt have been added back. Please test again, the Docker container should build and run without a hitch now. Thanks for your patience. |
I tested the Docker build. Looks good. Questions(1) Why are we using Python 3.5, rather than the latest 3.6.0? (2) Each time the image starts, it runs the migrations and imports the data as specified in Testing procedure
|
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.
See my questions in the Conversation
tab, but I think this is working well enough to merge.
Great questions @jimtyhurst - I've framed up two of your questions as separate issues ( #50 and #51 ). As to this question: "This makes me think that the image is accessing sqlite3 locally, rather than querying the PostgreSQL database running on an AWS EC2 instance. Or does the image use whatever database is specified in project_config.py?" I am pretty confident that the Docker image is using the AWS EC2-hosted PostgreSQL specified in project_config.py. During testing when I'd hit the /summary/ endpoint, my browser would often hang in ways that I hadn't previously seen before we introduced the DATABASE configuration change in |
Summary
This enables the Django app to run in a Docker container.
I have tested these changes both with and without Docker, to ensure that the Swagger styling appears in both non-Docker and Docker container contexts.
Testing
git pull
git checkout dockerize
cd budget_proj
docker-compose up --build
Browse to an endpoint e.g. http://localhost:8000/kpm/
You should see the Swagger-styled response from the endpoint
Next Steps After Merge
I will address the Travis failures once this has been merged. Travis testing results have been inconclusive given the flurry of activity in these files between branches and merges.