-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 861 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (25 loc) · 861 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
# Stage 1: Build frontend
FROM dockerhub.rainwu.cn/library/node:22-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# Stage 2: Python runtime
FROM dockerhub.rainwu.cn/library/python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
libmagic1 && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ app/
COPY main.py .
COPY migrations/ migrations/
COPY alembic.ini .
COPY scripts/ scripts/
# Copy frontend build output
COPY --from=frontend-build /app/frontend/dist /app/frontend/dist
# Data directory (mounted as volume)
RUN mkdir -p /app/data/photos /app/data/backups
EXPOSE 5001
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5001"]