fastapi-chat2 / Dockerfile
deepak191z's picture
Update Dockerfile
7760eb5 verified
raw
history blame
554 Bytes
FROM python:3.10-alpine
# Set working directory
WORKDIR /code
# Install build dependencies first (because Alpine is minimal)
RUN apk add --no-cache --virtual .build-deps \
gcc musl-dev libffi-dev make
# Install Python dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy app files
COPY . .
# Remove build dependencies to make final image lighter
RUN apk del .build-deps
# Command to run your app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]