refaelz's picture
Deploy updated challenge app to HF Space v2
5f3b513
Raw History Blame Contribute Delete
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}"]