question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deploying API with docker on AWS

See original GitHub issue

Hello,

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:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
luquitaredcommented, May 27, 2022

Ope. No, your suggestion worked. Ran it with RUN python -m pip install --no-cache-dir uvicorn[standard] & worked!

0reactions
davidmezzetticommented, May 27, 2022

Sounds good, glad you were able to get it to work!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found