-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 969 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 969 Bytes
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
34
35
36
37
38
39
# Stage 1: Build frontend
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
COPY frontend/ ./
RUN npm run build
# Stage 2: Python runtime
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Copy application code (needed before pip install for hatch force-includes)
COPY pyproject.toml README.md ./
COPY paperbanana/ ./paperbanana/
COPY prompts/ ./prompts/
COPY configs/ ./configs/
COPY data/ ./data/
# Install Python dependencies
RUN pip install --no-cache-dir .
# Copy built frontend
COPY --from=frontend-build /app/frontend/out ./frontend/out
# Set environment variables
ENV FRONTEND_DIR=/app/frontend/out
ENV PORT=8080
ENV PYTHONUNBUFFERED=1
EXPOSE 8080
CMD ["python", "-m", "uvicorn", "paperbanana.api.server:app", "--host", "0.0.0.0", "--port", "8080"]