| |
| FROM node:20-alpine AS frontend-builder |
| WORKDIR /app/frontend |
| COPY frontend/package.json frontend/package-lock.json* ./ |
| RUN npm install |
| COPY frontend/ ./ |
| RUN npm run build |
|
|
| |
| FROM python:3.12-slim |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| libpq-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN pip install --no-cache-dir uv |
|
|
| |
| |
| |
| COPY pyproject.toml uv.lock* README.md ./ |
| COPY contra/ ./contra/ |
|
|
| |
| RUN uv sync --frozen --no-dev || uv sync --no-dev |
|
|
| |
| COPY app.py ./ |
|
|
| |
| COPY --from=frontend-builder /app/frontend/dist ./frontend/dist |
|
|
| |
| ENV PORT=7860 |
| EXPOSE 7860 |
|
|
| CMD ["sh", "-c", "uv run uvicorn app:app --host 0.0.0.0 --port ${PORT}"] |
|
|