SarahXia0405 commited on
Commit
09f9bba
·
verified ·
1 Parent(s): 3863dc4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # ---- system deps (node for Vite build) ----
4
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
5
+ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
6
+ && apt-get update && apt-get install -y nodejs \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ WORKDIR /app
10
+
11
+ # ---- Python deps ----
12
+ COPY requirements.txt /app/requirements.txt
13
+ RUN pip install --no-cache-dir -r /app/requirements.txt
14
+
15
+ # ---- Copy source ----
16
+ COPY api/ /app/api/
17
+ COPY web/ /app/web/
18
+
19
+ # ---- Build React ----
20
+ WORKDIR /app/web
21
+ RUN npm install
22
+ RUN npm run build
23
+
24
+ # ---- Run API (serves web dist too) ----
25
+ WORKDIR /app
26
+ ENV PORT=7860
27
+ CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]