Spaces:
Paused
Paused
| FROM node:20-slim AS frontend-build | |
| WORKDIR /src/frontend | |
| COPY frontend/package.json frontend/package-lock.json ./ | |
| RUN npm ci | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| FROM python:3.11-slim AS runtime | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=7860 | |
| WORKDIR /app/TraePro/backend | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libgtk-3-0 \ | |
| libdbus-glib-1-2 \ | |
| libasound2 \ | |
| libnss3 \ | |
| libx11-xcb1 \ | |
| libxss1 \ | |
| libxtst6 \ | |
| libgbm1 \ | |
| libatk-bridge2.0-0 \ | |
| libatk1.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libxkbcommon0 \ | |
| libpango-1.0-0 \ | |
| libpangocairo-1.0-0 \ | |
| libcairo2 \ | |
| libgdk-pixbuf-xlib-2.0-0 \ | |
| libfontconfig1 \ | |
| libgl1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN python -m pip install --no-cache-dir uv | |
| COPY backend/pyproject.toml backend/uv.lock ./ | |
| RUN uv sync --frozen | |
| COPY backend/ ./ | |
| COPY --from=frontend-build /src/frontend/dist ../frontend/dist | |
| RUN uv run python -m playwright install --with-deps chromium | |
| EXPOSE 7860 | |
| CMD ["uv", "run", "python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |