This is a Dockerfile that builds an image based on ubuntu for running web2py as a Docker container. The file is inspired by O.S. Tezer's tutorial on containerizing Python web apps on the DigitalOcean community site.
-
Install and run Docker.
-
Once you are up and running with Docker, copy the Dockerfile to the root directory of your project and run Docker build:
sudo docker build -t [image name] .
- Run a container based on your newly created image
sudo docker run --name [container name] -p [host port]:[docker port] -i -t [image name]