File size: 647 Bytes
98bc29d 108c4c3 98bc29d 108c4c3 98bc29d 5af1bed 98bc29d 108c4c3 5af1bed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
ENV HF_HOME=/code/huggingface_cache
RUN mkdir -p $HF_HOME && \
chmod -R 777 $HF_HOME
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code into the container
COPY ./app /code/app
COPY ./static /code/static
COPY ./index.html /code/index.html
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |