ChristopherJKoen commited on
Commit
002212a
·
1 Parent(s): 0418ff4

Add Dockerfile for HF Space

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20 AS frontend
2
+ WORKDIR /app
3
+ COPY frontend/package*.json frontend/
4
+ RUN cd frontend && npm ci
5
+ COPY frontend frontend
6
+ RUN cd frontend && npm run build
7
+
8
+ FROM python:3.11-slim
9
+ WORKDIR /app
10
+
11
+ ENV PYTHONDONTWRITEBYTECODE=1
12
+ ENV PYTHONUNBUFFERED=1
13
+ ENV FRONTEND_BASE_URL=http://localhost:7860
14
+
15
+ COPY server/requirements.txt server/requirements.txt
16
+ RUN pip install --no-cache-dir -r server/requirements.txt \
17
+ && python -m playwright install chromium --with-deps
18
+
19
+ COPY server server
20
+ COPY --from=frontend /app/frontend/dist frontend/dist
21
+
22
+ EXPOSE 7860
23
+ CMD ["uvicorn","server.app.main:app","--host","0.0.0.0","--port","7860"]