CoolFace
Apppublic

ace7s/mpoxscanccs6

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
Dockerfile57 linesDownload Raw Back to root
1# syntax=docker/dockerfile:12 3# Comments are provided throughout this file to help you get started.4# If you need more help, visit the Dockerfile reference guide at5# https://docs.docker.com/go/dockerfile-reference/6 7# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk78 9ARG PYTHON_VERSION=3.12.710FROM python:${PYTHON_VERSION} as base11 12# Prevents Python from writing pyc files.13ENV PYTHONDONTWRITEBYTECODE=114ENV HF_HOME=/tmp/huggingface15 16# Keeps Python from buffering stdout and stderr to avoid situations where17# the application crashes without emitting any logs due to buffering.18ENV PYTHONUNBUFFERED=119 20WORKDIR /app21 22# Copy the current directory contents into the container at /app23COPY . /app24 25 26# Create a non-privileged user that the app will run under.27# See https://docs.docker.com/go/dockerfile-user-best-practices/28ARG UID=1000129RUN adduser \30    --disabled-password \31    --gecos "" \32    --home "/nonexistent" \33    --shell "/sbin/nologin" \34    --no-create-home \35    --uid "${UID}" \36    appuser37 38# Download dependencies as a separate step to take advantage of Docker's caching.39# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.40# Leverage a bind mount to requirements.txt to avoid having to copy them into41# into this layer.42RUN --mount=type=cache,target=/root/.cache/pip \43    --mount=type=bind,source=requirements.txt,target=requirements.txt \44    python -m pip install -r requirements.txt45 46# Switch to the non-privileged user to run the application.47USER appuser48 49# Copy the source code into the container.50COPY . .51 52 53# Expose the port that the application listens on.54EXPOSE 786055 56# Run the application.57CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]