This video example shows how to:
- Edit your container code
- Raise a new pull request
- Deploy the newest version automatically 🚀
Container_hosting_service_Simple_Container_Hosting_Platform_how-to.mp4
By now, you have deployed a container, and in moments, you can visit your app live!
Be patient! In ~3 mins your app is live, at your app url. It even has a free SSL/TLS certificate 🔒 you're welcome!
You probably want to add code to your app. Good news, your app is ready right now to start coding, which is simple:
- Edit your code
- Commit your code
- Push your code
git push origin main
Your app will be automatically re-deployed with the latest code at: https://container-fsutqem.containers.anotherwebservice.com/
You app is deployed already and is working software. Gone are the days of spending weeks coding and then another week going to production. No. Go to production early and respond to change.
Step 0: You need to download your repo to your computer:
git clone git@github.com:ashercaulfield/container-fsutqem.git
cd container-fsutqem
See an error? You might need to setup permissions here's a guide how to setup repo clone permissions
-
Start your container locally:
docker-compose up
-
Visit your app locally: http://127.0.0.1:5000/
Visit: http://127.0.0.1:5000/
If you make changes to Dockerfile
, then you need to rebuild your container image. To rebuild the container image:
docker-compose build
# or
docker-compose up --build
Need some help to get started?
How do I turn on the debugger?
Enable a breakpoint by adding breakpoint()
to your code, start your application and run to that point then in a terminal type:
docker attach container-fsutqem
Ta-da! You'll be inside the Python debugger ( ⬅️ Read this!)
- How was this built? All code is here
- How can I use a customized port numberi/change the port number listened on? You don't need to do this if you use the quickstarts. But if you do want to alter the port: Edit your
Dockerfile
and changeEXPOSE
to the port number you want your app to listen on. Understand that all apps go through the proxy (nginx) listening on port80
and443
, requests to your app get proxied (based on your hostname) to the port number you put afterEXPOSE
in your yourDockerfile
. For exampleEXPOSE 3000
means you want the Dokku nginx proxy to forward port80
and443
connections to port3000
. You still need to make your application listen on your chosen port.