Spaces:
Sleeping
Sleeping
Download Dockerfile from refaelz/legacy-code-challenge-v2: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/spaces/refaelz/legacy-code-challenge-v2/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/refaelz/legacy-code-challenge-v2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/refaelz/legacy-code-challenge-v2/resolve/main/Dockerfile
908 Bytes
| FROM node:22-bookworm-slim AS frontend-build | |
| RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /frontend | |
| COPY frontend/package.json frontend/package-lock.json ./ | |
| RUN npm ci | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| FROM python:3.11-slim AS app | |
| WORKDIR /app | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends git && \ | |
| apt-get upgrade -y && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* && \ | |
| useradd --create-home --uid 1000 appuser | |
| COPY requirements-api.txt ./ | |
| RUN pip install --no-cache-dir -r requirements-api.txt | |
| COPY --chown=appuser:appuser . ./ | |
| COPY --from=frontend-build --chown=appuser:appuser /frontend/dist ./frontend/dist | |
| RUN mkdir -p /app/workspaces && chown -R appuser:appuser /app | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| USER appuser | |
| CMD ["sh", "-c", "uvicorn backend.app:app --host 0.0.0.0 --port ${PORT:-7860}"] | |