Using docker to deploy a uvicorn server to serve some tensorflow model. The end of the dockerfile looks like this.
# Start ASGI server
CMD ['./runserver.sh']
The runserver.sh
looks like this
#!/usr/bin/env bash
# encoding:utf-8
# This is a blocking call
uvicorn gateway:app --host=0.0.0.0 --workers 20 # Default port 8000
This is the command I am using to start the container
docker run --detach --publish 8000:8000 tensor_image
My expectation and goal: The container will stay alive until killed with a docker stop command and a client can send request to the uvicorn server.
What is happening: The docker run command just echoes a long id of the container on terminal and then the container dies.
How to keep it running? Also, how to view the server log itself if I make uvicorn log its content to a local file inside the container?
Using Linux mint ulyana as my operating system if that is important. Some additional clari