forked from trentferguson/homescreen-hero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (36 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (36 loc) · 1.31 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
# ============================
# 1) Build the Vite frontend
# ============================
FROM node:20-alpine AS ui-build
WORKDIR /ui
# Install dependencies
COPY homescreen-hero-ui/package*.json ./
RUN npm ci
# Copy source and build
COPY homescreen-hero-ui/ ./
RUN npm run build
# Build output: /ui/dist
# ============================
# 2) Python runtime image
# ============================
FROM python:3.12-slim AS runtime
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Optional: curl for healthchecks / debugging
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY homescreen_hero/requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy backend code and version file
COPY homescreen_hero/ /app/homescreen_hero/
COPY VERSION /app/VERSION
# Copy built frontend into the exact folder FastAPI serves
# (your FastAPI expects: homescreen_hero/web/frontend/index.html)
RUN mkdir -p /app/homescreen_hero/web/frontend
COPY --from=ui-build /ui/dist/ /app/homescreen_hero/web/frontend/
EXPOSE 8000
# IMPORTANT: single worker recommended (APScheduler runs in-process)
CMD ["uvicorn", "homescreen_hero.web.app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]