-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 773 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (21 loc) · 773 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
FROM python:3.11-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:0.7.3 /uv /uvx /bin/
# Install Node.js 20 (needed for building Vite frontend)
RUN apt update && apt install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt install -y nodejs && \
apt clean && rm -rf /var/lib/apt/lists/*
# Set work directory
WORKDIR /app
# Copy only dependency files first for better Docker cache
COPY pyproject.toml uv.lock ./
# Install dependencies using uv
RUN uv sync
# Copy rest of the application
COPY . .
# Build frontend
RUN cd frontend && npm install && npm run build
# Expose FastAPI port
EXPOSE 8000
# Start the app
CMD ["uv", "run", "python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]