deploying API with docker on AWS
See original GitHub issueHello,
I am currently attempting to run this dockerfile on an EC2 instance on amazon AWS. The instance being used has a lot of CPU and RAM.
FROM neuml/txtai-cpu
# Copy configuration
COPY config.yml .
RUN python -c "from txtai.api import API; API('config.yml', False)"
# Start server and listen on all interfaces
ENV CONFIG "config.yml"
ENTRYPOINT ["uvicorn", "--host", "0.0.0.0", "--port", "80", "txtai.api:app"]
EXPOSE 80
I have to use EXPOSE 80
because I using amazon EBS.
When reading the logs, I can see the app is running:
INFO: Application startup complete.
2022-05-26 06:36:46,997 [INFO] startup: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
2022-05-26 06:36:47,001 [INFO] _log_started_message: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
When I try to access the service at localhost:80/docs or localhost:8000/docs I receive this error:
No supported WebSocket library detected. Please use 'pip install uvicorn[standard]', or install 'websockets' or 'wsproto' manually.
I don’t know how to view the original txtai-cpu image, otherwise, I’d try to modify that logic. Am I making a mistake or is this something related to the dockerfile?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Run an ASP.NET Core web API Docker container on an ...
Open the Amazon EC2 console. · In the navigation pane, choose Instances. · Select the Amazon Linux 2 demo instance, and choose Connect....
Read more >Dockerize an API based Flask app and deploy on Amazon ECS
Dockerize an API based Flask app and deploy on Amazon ECS · Pre-Requisites: · About the API · Source: [Flask_API_App] · Dockerfile ·...
Read more >Deploying Docker containers on ECS - Docker Documentation
Create AWS context ... Run the docker context create ecs myecscontext command to create an Amazon ECS Docker context named myecscontext...
Read more >Deploy a dockerized FastAPI application to AWS
... simple application with FastAPI, dockerizing it, and deploying to AWS EC2. ... fast (high-performance), web framework for building APIs with Python 3.6+ ......
Read more >Fast API, Docker and AWS ECS to Deploy ML Model
Push docker image to Docker hub; Deploy it on AWS ECS (Elastic Container Service). In between these topics, we will also cover the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ope. No, your suggestion worked. Ran it with
RUN python -m pip install --no-cache-dir uvicorn[standard]
& worked!Sounds good, glad you were able to get it to work!