Spaces:
Build error
Build error
| FROM python:3.11-slim | |
| # Install system dependencies, databases, Node.js, and supervisor | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| curl \ | |
| gnupg \ | |
| redis-server \ | |
| postgresql \ | |
| postgresql-contrib \ | |
| supervisor \ | |
| && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ | |
| && apt-get install -y nodejs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install MongoDB | |
| RUN curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-6.0.gpg \ | |
| && echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \ | |
| && apt-get update && apt-get install -y mongodb-org-server \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy all project folders | |
| COPY backend ./backend | |
| COPY frontend ./frontend | |
| # Install backend dependencies | |
| RUN pip install uv && uv pip install --system -r backend/requirements.txt | |
| # Install frontend dependencies and build Next.js | |
| WORKDIR /app/frontend | |
| ENV NEXT_PUBLIC_API_URL=http://localhost:8000 | |
| ENV NEXT_PUBLIC_WS_URL=ws://localhost:8000 | |
| RUN npm ci && npm run build | |
| # Copy supervisor config and entrypoint script | |
| WORKDIR /app | |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| COPY entrypoint.sh /app/entrypoint.sh | |
| RUN chmod +x /app/entrypoint.sh | |
| EXPOSE 3000 | |
| EXPOSE 8000 | |
| ENTRYPOINT ["/app/entrypoint.sh"] | |