| Instruction | Comments |
|---|---|
image: easygeoip_app |
Name of the docker image after build |
build: . |
Instruct docker compose to build the image with the Dockerfile under the current directory |
command: ["python", "/srv/app/main.py"] |
Change the default command so that the application can be restarted whenever the source code is updated |
volumes |
Mount the current directory at /srv/app in the application's container. This is very handy, since an update to the source code won''t require rebuilding the Docker Image (and hence restarting the application container) |
ports |
Map port 5000 on the container to port 5000on the host. default all Flask's application use port 5000 the web server port so we're just making sure that it's accessible. |
environment |
Here were passing the environment variables required by the application. DEBUG=1 it's very important since Flask will restart the application whenever the source code is updated. |
Last active
May 16, 2017 02:56
-
-
Save yoanisgil/ab47928a09db2b019902a23d27e82d9a to your computer and use it in GitHub Desktop.
Table for article: https://medium.com/@yoanis_gil/python-docker-from-development-to-production-episode-i-427674710f3e
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment