Question

Need more docker reference

Posted October 19, 2021 125 views
Docker

I’m trying to figure out if I can deploy a dockerfile in DO. I have a few questions:

  1. Can I run the image interactively? It has some first-time setup procedure that require user input. After that it can start non-interactive.
  2. Do I need to map ports? The image runs Apache on port 80.

Can I achieve the above with a run_command value in deploy.template.yaml ?

1 comment

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hey there!

You can deploy a Dockerfile in App Platform.

There is an interactive console that is available to use in App Platform, but it is only available after a successful deploy. It is also limited in what commands can be run. Any elevated privilege commands would fail. If you can deploy without using the console then you could access it post deploy to add the additional input.

For Dockerfile builds you would only need to expose the port you are wanting it to be accessed on. All traffic is routed through 443 in App platform to the port specified in your app spec which typically would be the same port you expose in your Dockerfile.

The run command unfortunately wouldn’t be able to do any of the console commands, as it isn’t available till after deployment.

Hope it helps!
Nate