Spaces:
Running
Running
File size: 840 Bytes
194c008 31920aa 8e59ef0 31920aa 46e1e20 | 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 | # ---------- Frontend build ----------
FROM node:18-alpine AS frontend
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# ---------- Backend runtime ----------
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential libffi-dev libgl1 libxrender1 libxext6 libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV DB_PATH=/tmp/usage.db
# Install backend deps
COPY backend/requirements.txt .
RUN pip install -r requirements.txt
# Copy backend code
COPY backend/ ./
# Bring in built frontend as static assets
COPY --from=frontend /app/dist ./static
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |