I’m trying to deploy a FastApi app in a docker space, I’ve got the following error:
Runtime error
launch timed out, space was not healthy after 30 min
Container logs:
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8010 (Press CTRL+C to quit)
The app is stuck in the build phase despite showing the INFO: Uvicorn running on http://0.0.0.0:8010 (Press CTRL+C to quit)
log. and the build ends up by a runtime error.
this is my dockerfile
FROM python:3.9-slim-buster
WORKDIR /app
# install dependencies
COPY ./requirements.txt /app
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN apt-get update && apt-get install -y libsndfile1
RUN apt-get update && apt-get install -y ffmpeg
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8010"]
and this is my docker-compose file:
services:
app:
build: .
container_name: gpt-summary
command: uvicorn main:app --host 0.0.0.0 --port 8010 --reload
ports:
- 8000:8010
volumes:
- .:/app
Please, Can anyone help?