Spaces:
Sleeping
Sleeping
File size: 1,109 Bytes
5edc004 f68b5d6 5edc004 f68b5d6 5edc004 f68b5d6 5edc004 f68b5d6 5edc004 f68b5d6 5edc004 6af6856 5edc004 6af6856 5edc004 6af6856 5edc004 6af6856 5edc004 6af6856 | 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | # # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# # you will also find guides on how best to write your Dockerfile
# FROM python:latest
# RUN useradd -m -u 1000 user
# USER user
# ENV PATH="/home/user/.local/bin:$PATH"
# WORKDIR /app
# COPY --chown=user ./requirements.txt requirements.txt
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
# COPY --chown=user . /app
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
# FROM python:3.11-slim
# WORKDIR /root
# COPY requirements.txt .
# RUN pip install --no-cache-dir -r requirements.txt
# COPY app ./app
# COPY artifacts ./artifacts
# ENV PYTHONUNBUFFERED=1
# ENV HF_HOME=/root/.cache/huggingface
# EXPOSE 8000
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
COPY artifacts ./artifacts
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
ENV HF_HOME=/data/.huggingface
EXPOSE 7860
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PORT}"]
|