File size: 1,060 Bytes
087ddd7 | 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 | FROM python:3.11-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
HOME=/home/user \
FIFTYONE_DO_NOT_TRACK=true
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ffmpeg \
libcurl4 \
php-curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --uid 1000 user
WORKDIR /app
COPY requirements.txt patch_fiftyone_frontend.py datasets.json /app/
RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \
&& python -m pip install --no-cache-dir -r /app/requirements.txt \
&& python /app/patch_fiftyone_frontend.py
COPY --chown=user:user app.py gateway.py README.md /app/
RUN mkdir -p /home/user/.fiftyone /home/user/fiftyone \
&& chown -R user:user /home/user /app
USER user
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=10s --start-period=10m --retries=5 \
CMD curl --fail --silent --show-error http://127.0.0.1:7860/__health > /dev/null || exit 1
CMD ["python", "-u", "app.py"]
|