-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.33 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (40 loc) · 1.33 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
50
# ===========================
# Stage 1: Build Frontend
# ===========================
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# ===========================
# Stage 2: Python Runtime
# ===========================
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libimage-exiftool-perl \
libraw-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ ./backend/
# Copy built frontend
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
# Environment defaults (override with docker-compose or .env)
ENV IMPORT_DIR=/app/data/import
ENV ORIGINALS_DIR=/app/data/originals
ENV THUMB_DIR=/app/data/thumbnails
ENV DARKROOM_DIR=/app/data/darkroom
ENV DB_PATH=/app/data/raw_manager.db
ENV API_HOST=0.0.0.0
ENV API_PORT=8000
ENV THUMB_SIZE=800
EXPOSE 8000
HEALTHCHECK --interval=10s --timeout=5s --retries=3 --start-period=10s \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"
# Default: run the API server
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]