This command will run our docker-example container in “interactive” mode meaning it will output the console output, additionally it will map the exposed port 5000 of our container to our localhost port 5000 and the --rm will make sure to remove the Docker container when we quit the application using Ctrl+C .

You should now be able to go again to https://localhost:5000 and see Hello World .



If everything is working you can stop the Docker container by exiting it using Ctrl+C .

Deploy your Docker to now.sh

Our Docker container is ready and it’s time to deploy it to the cloud. The great thing is that we can run this container on various cloud hosts by uploading our built container image into a registry like Docker Hub and then instructing a cloud host like Azure to deploy the respective container image. We will look at an alternative though.

now.sh is a cloud hosting platform that allows us to easily deploy Docker project. The great thing is that it doesn’t require you to build the container image on your computer or host it in any registry. Instead it will build the container for you in the cloud. Additionally it will take care of scaling and host it on Google Cloud Engine as well as Amazon Web Services.

A warning in advance: The free plan of now is designed for open source projects. As part of that it will enable you to inspect the source of your application by going to /_src on your deployed project to inspect the source. Meaning only use this free plan if you are deploying an application without sensitive data. Sensitive data should be stored in secrets and loaded via environment variables.

To start with now install the CLI or alternatively the now Desktop application (which includes the CLI) from now’s download page. Once it’s installed and you are registered it’s time to deploy our app.

Once the CLI is installed all you need to do run in the command-line of your project directory: