Spaces:
Sleeping
Sleeping
File size: 865 Bytes
dc42cb3 5867928 dc42cb3 5867928 dc42cb3 5867928 dc42cb3 5867928 dc42cb3 | 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 | # CloudOps Optimizer Environment Dockerfile
ARG BASE_IMAGE=ghcr.io/meta-pytorch/openenv-base:latest
FROM ${BASE_IMAGE} AS builder
WORKDIR /app
COPY . /app
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-install-project --no-editable
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-editable
FROM ${BASE_IMAGE}
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app /app
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app:$PYTHONPATH"
ENV PORT=7860
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1
EXPOSE 7860
CMD ["python", "main.py"] |