Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim AS backend
|
| 2 |
+
WORKDIR /app
|
| 3 |
+
COPY backend/requirements.txt .
|
| 4 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 5 |
+
COPY backend/ .
|
| 6 |
+
COPY data/ /data
|
| 7 |
+
|
| 8 |
+
FROM node:18-alpine AS frontend-build
|
| 9 |
+
WORKDIR /app/frontend
|
| 10 |
+
COPY frontend/package*.json ./
|
| 11 |
+
RUN npm ci
|
| 12 |
+
COPY frontend/ .
|
| 13 |
+
RUN npm run build
|
| 14 |
+
|
| 15 |
+
FROM python:3.11-slim
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
COPY --from=backend /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
| 18 |
+
COPY --from=backend /app /app
|
| 19 |
+
COPY --from=frontend-build /app/frontend/build /app/static
|
| 20 |
+
|
| 21 |
+
RUN apt-get update && apt-get install -y git nodejs npm curl && rm -rf /var/lib/apt/lists/*
|
| 22 |
+
# Allow sandbox command execution
|
| 23 |
+
RUN mkdir /sandbox && chmod 777 /sandbox
|
| 24 |
+
|
| 25 |
+
ENV PYTHONUNBUFFERED=1
|
| 26 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|