| FROM node:20-slim | |
| # Install Python and pip for the scraper | |
| RUN apt-get update && apt-get install -y python3 python3-pip python3-venv && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy Python requirements and install | |
| COPY requirements.txt . | |
| RUN pip3 install --break-system-packages -r requirements.txt | |
| # Copy project files | |
| COPY scrape_jarchive.py . | |
| COPY schema.sql . | |
| # Install Node dependencies and build frontend | |
| COPY web/package*.json web/ | |
| RUN cd web && npm ci | |
| COPY web/ web/ | |
| RUN cd web && npm run build | |
| # Hugging Face Spaces exposes port 7860 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["node", "web/server.js"] | |