| 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"] | |