I just deployed a fastapi server with docker runtime.
Here is my Dockerfile
FROM python:3.10-buster
ENV VAR1=10
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf -y https://sh.rustup.rs | sh
ENV PATH /home/pn/.cargo/bin:$PATH
# Install & use pipenv
COPY Pipfile .
RUN python -m pip install --upgrade pip
RUN pip install pipenv
RUN pipenv lock && pipenv --clear && pipenv --rm
RUN GIT_LFS_SKIP_SMUDGE=1 pipenv install --system
WORKDIR /app
COPY . /app
EXPOSE 3000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]