-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (35 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
49 lines (35 loc) · 1.19 KB
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
40
41
42
43
44
45
46
47
48
49
# Build frontend
FROM node:22-bookworm-slim AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Production image
FROM python:3.13-slim
WORKDIR /app
# Install system dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
# Copy backend
COPY backend/ ./
# Copy built frontend from builder stage
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
# Create data directory for persistent storage
RUN mkdir -p /app/data
# Environment variables
ENV PYTHONUNBUFFERED=1
ENV SPOOLBUDDY_DATABASE_PATH=/app/data/spoolbuddy.db
ENV SPOOLBUDDY_STATIC_DIR=/app/frontend/dist
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:3000/api/spools')" || exit 1
# Run the application
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]