CoolFace
Apppublic

ZealPyae/V2APIToCheck

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
Dockerfile44 linesDownload Raw Back to root
1# # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker2# # you will also find guides on how best to write your Dockerfile3 4# FROM python:3.95 6# RUN useradd -m -u 1000 user7# USER user8# ENV PATH="/home/user/.local/bin:$PATH"9 10# WORKDIR /app11 12# COPY --chown=user ./requirements.txt requirements.txt13# RUN pip install --no-cache-dir --upgrade -r requirements.txt14 15# COPY --chown=user . /app16# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]17 18# Use the official lightweight Python image.19# https://hub.docker.com/_/python20FROM python:3.8-slim21 22# Allow statements and log messages to immediately appear in the logs23ENV PYTHONUNBUFFERED=True24 25# Set the TRANSFORMERS_CACHE environment variable26ENV TRANSFORMERS_CACHE=/app/cache27 28# Create the cache directory and set permissions29RUN mkdir -p /app/cache && chmod -R 777 /app/cache30 31# Copy requirements.txt and install dependencies32COPY requirements.txt .33RUN pip install -r requirements.txt34 35# Copy the rest of the application code36COPY . /app37WORKDIR /app38 39# Run the FastAPI app with uvicorn40CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]41 42 43 44