SarahXia0405 commited on
Commit
e010f62
·
verified ·
1 Parent(s): c0120ec

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -3
Dockerfile CHANGED
@@ -6,7 +6,7 @@ WORKDIR /web
6
  COPY web/package*.json ./
7
  RUN npm install
8
  COPY web/ ./
9
- RUN npm run build # -> outputs /web/build (per your log)
10
 
11
  # =========================
12
  # 2) API runtime stage
@@ -15,6 +15,11 @@ FROM python:3.11-slim
15
 
16
  WORKDIR /app
17
 
 
 
 
 
 
18
  # ---- Python deps ----
19
  COPY requirements.txt /app/requirements.txt
20
  RUN pip install --no-cache-dir -r /app/requirements.txt
@@ -25,7 +30,6 @@ COPY api/ /app/api/
25
  # ---- Copy built web assets ----
26
  COPY --from=web_builder /web/build /app/web/build
27
 
28
- # ---- Run API (serves web build too) ----
29
  ENV PORT=7860
30
  EXPOSE 7860
31
- CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]
 
6
  COPY web/package*.json ./
7
  RUN npm install
8
  COPY web/ ./
9
+ RUN npm run build
10
 
11
  # =========================
12
  # 2) API runtime stage
 
15
 
16
  WORKDIR /app
17
 
18
+ # ✅ Dev Mode needs git for injected "git config" steps
19
+ RUN apt-get update \
20
+ && apt-get install -y --no-install-recommends git ca-certificates \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
  # ---- Python deps ----
24
  COPY requirements.txt /app/requirements.txt
25
  RUN pip install --no-cache-dir -r /app/requirements.txt
 
30
  # ---- Copy built web assets ----
31
  COPY --from=web_builder /web/build /app/web/build
32
 
 
33
  ENV PORT=7860
34
  EXPOSE 7860
35
+ CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]