KeyStone commited on
Commit
6a4dbef
Β·
1 Parent(s): 0058346

Serve Expo web build from FastAPI

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -0
  2. backend/app/main.py +2 -0
Dockerfile CHANGED
@@ -26,6 +26,7 @@ RUN pip install --no-cache-dir --upgrade pip && \
26
  pip install --no-cache-dir -r requirements.txt
27
 
28
  COPY backend/ .
 
29
 
30
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
31
  USER appuser
 
26
  pip install --no-cache-dir -r requirements.txt
27
 
28
  COPY backend/ .
29
+ COPY --from=frontend /frontend/dist ./web
30
 
31
  RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
32
  USER appuser
backend/app/main.py CHANGED
@@ -61,6 +61,8 @@ app.include_router(gallery.router, prefix="/photos", tags=["Gallery"])
61
  app.include_router(albums.router, prefix="/albums", tags=["Albums"])
62
  app.include_router(search.router, prefix="/search", tags=["Search"])
63
 
 
 
64
 
65
  # ── Health ────────────────────────────────────────────────────────────────────
66
  @app.get("/health", tags=["Health"])
 
61
  app.include_router(albums.router, prefix="/albums", tags=["Albums"])
62
  app.include_router(search.router, prefix="/search", tags=["Search"])
63
 
64
+ # Serve Expo web build
65
+ app.mount("/", StaticFiles(directory="web", html=True), name="web")
66
 
67
  # ── Health ────────────────────────────────────────────────────────────────────
68
  @app.get("/health", tags=["Health"])