Spaces:
Configuration error
Configuration error
Upload folder using huggingface_hub
Browse files- Dockerfile +15 -1
Dockerfile
CHANGED
|
@@ -1,7 +1,21 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
COPY requirements.txt .
|
| 5 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
COPY . .
|
| 7 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# ---- deps stage: needs git + a credentialed clone of the private ARF repos
|
| 2 |
+
# (agentic_reliability_framework, ARF-Bayesian-Pricing-Calculator).
|
| 3 |
+
# This stage is discarded after build -- the credential never reaches
|
| 4 |
+
# the final image's layers, env, or git config. ----
|
| 5 |
+
FROM python:3.12-slim AS deps
|
| 6 |
+
ARG GH_PAT
|
| 7 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 8 |
+
RUN git config --global url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/"
|
| 9 |
+
RUN python -m venv /opt/venv
|
| 10 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 11 |
WORKDIR /app
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# ---- final stage: just the built venv + app code, no git, no credential ----
|
| 16 |
+
FROM python:3.12-slim
|
| 17 |
+
COPY --from=deps /opt/venv /opt/venv
|
| 18 |
+
ENV PATH="/opt/venv/bin:$PATH"
|
| 19 |
+
WORKDIR /app
|
| 20 |
COPY . .
|
| 21 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|