We will be deploying this on kubernetes, so we need to build a Dockerfile that can be used to deploy this.
Use the official python docker image as the base image. gunicorn should be included in the image so it can be used to actually run the server.
Per the Linux FHS, let's put the code for this project under /opt - maybe under /opt/unnamed-thingity-thing (to be renamed later)
Definition of done
[x] Docker image builds with docker build when tried locally
[x] Doing a docker run --entrypoint /bin/bash -p 8000:8000 -it <image-name> brings up a shell
[x] pip list in the shell lists all the packages needed for the software to run
[x] Running python manage.py migrate creates a base db inside the container
[x] Running gunicorn with appropriate parameters servers the django app, and it can be accessed in the host machine via a browser on port 8000 (this was what the -p in the docker run command was for)
We will be deploying this on kubernetes, so we need to build a
Dockerfile
that can be used to deploy this.Use the official python docker image as the base image.
gunicorn
should be included in the image so it can be used to actually run the server.Per the Linux FHS, let's put the code for this project under
/opt
- maybe under/opt/unnamed-thingity-thing
(to be renamed later)Definition of done
docker build
when tried locallydocker run --entrypoint /bin/bash -p 8000:8000 -it <image-name>
brings up a shellpip list
in the shell lists all the packages needed for the software to runpython manage.py migrate
creates a base db inside the containergunicorn
with appropriate parameters servers the django app, and it can be accessed in the host machine via a browser on port 8000 (this was what the-p
in thedocker run
command was for)