Hey y'all.

I have a very simple python API using Docker. I can build and run it just fine in my local environment but when adding this app to App Platform it starts to build fine but then fails to run.

In my local env I use the following command to run it:

docker run -i -t -p "0.0.0.0:8181:8080" mycontainer:latest

Where can I find more information on how App Platform handles these type of deployments. I have looked at every possible App Platform documentation but could not find it.

Best regards,

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.

×
2 answers

👋 @moura

By default App Platform will try to use buildpacks to automatically detect your app type and then build a container on that.

If you would prefer to use your Dockerfile you can specify this by creating your app with the doctl tool.

Here’s the process to update an existing app:

  1. Get the app spec from the App Platform cloud by going to your app, then Settings, and viewing the App Spec, save this to a file.
  2. Next update the service that has the python api to include the dockerfile_path property. Here’s more info on the app spec.
  3. Now it’s time to deploy our changes using the doctl tool. Here are some install instructions.
  4. The command doctl apps update <app id> ---spec <your app spec> will trigger an update to your app

And that should get your python api running using the Dockerfile. If you run into specific issues with your App on App Platform please submit a ticket and we can take a look!

Thanks! Happy Hacking!

  • Hey! Thank you for the quick reply.

    I just double checked, my build goes perfectly but then it fails to run. My Dockerfile specifies the CMD command and my app listens on port 8080 so the default deploy by github should work.

    When deploying I only get this output from the python app:

    OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
    

    I tried to find out if this was the issue but could not find anything relevant. The deployment is failing silently :(

    Best regards

    • @moura 👋

      If the deployment is failing silently with a non-zero exit code error, it could mean that the container is OOMing. There are some cases where that’s not surfaced properly yet in the error code. You could check the memory usage locally in dev and increase the instance size of the app component based on that as an initial size.

Hey! Thank you for the quick reply.

I just double checked, my build goes perfectly but then it fails to run. My Dockerfile specifies the CMD command and my app listens on port 8080 so the default deploy by github should work.

When trying to run I only get this output from the python app:

OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k

I tried to find out if this was the issue but could not find anything relevant.

Best regards

Submit an Answer