- Newest
- Most votes
- Most comments
Unfortunately, it appears that deploying a Docker container directly on AWS Amplify is not currently possible. Amplify is primarily designed for hosting static websites and serverless web applications, not for running containerized applications like your Gradio app.
The reason you're unable to change the platform from Web to Web_Compute in the Amplify console is that Amplify doesn't support Docker-based deployments. The platform is looking for static web assets like index.html, which is why it's ignoring your Dockerfile.
Amplify's build process is not designed to build or run Docker containers. Including instructions in the amplify.yml file to point to a Docker build won't help in this case, as Amplify doesn't have the capability to execute Docker commands or manage containers.
For your Gradio app in a Docker container, you would need to consider alternative AWS services that are better suited for container deployments. Some options you might want to explore include:
-
AWS App Runner: This service is designed for containerized web applications and APIs, and it can deploy directly from a container image.
-
Amazon ECS (Elastic Container Service) or EKS (Elastic Kubernetes Service): These services are specifically for running and managing Docker containers.
-
AWS Fargate: This is a serverless compute engine for containers that works with both ECS and EKS.
If you still want to use Amplify, you would need to restructure your application to fit Amplify's serverless model, which might involve separating the frontend and backend components and using other AWS services to host the Gradio backend.
Sources
Amplify build machines cannot install docker or build docker images | AWS re:Post
AWS Amplify FAQs | Front-End Web & Mobile | Amazon Web Services
Key considerations when using AWS for web hosting - Web Application Hosting in the AWS Cloud
Hello.
As of March 2025, it seems that it is not possible to change the platform from the management console, so how about setting the platform using AWS CLI or similar as shown below?
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/amplify/update-app.html
aws amplify update-app --app-id your-appID --platform 'WEB_COMPUTE' --region ap-northeast-1
I appreciate the quick answer. In the end, Amplify felt like a square peg round hole solution. Switched to App Runner and everything is silky. All the best.
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
App Runner is the solution.