Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
|
@@ -8,17 +8,23 @@ RUN npm run build
|
|
| 8 |
|
| 9 |
# Use Python for the FastAPI backend
|
| 10 |
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
# Install dependencies
|
| 14 |
-
COPY backend/requirements.txt ./
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
# Copy backend code
|
| 18 |
-
COPY backend/ ./backend/
|
| 19 |
|
| 20 |
# Copy built frontend from builder stage
|
| 21 |
-
COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
|
| 22 |
|
| 23 |
# Expose Hugging Face Space port
|
| 24 |
EXPOSE 7860
|
|
|
|
| 8 |
|
| 9 |
# Use Python for the FastAPI backend
|
| 10 |
FROM python:3.12-slim
|
| 11 |
+
|
| 12 |
+
# Create user with UID 1000 as required by Hugging Face Spaces
|
| 13 |
+
RUN useradd -m -u 1000 user
|
| 14 |
+
USER user
|
| 15 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 16 |
+
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
# Install dependencies
|
| 20 |
+
COPY --chown=user backend/requirements.txt ./
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
# Copy backend code
|
| 24 |
+
COPY --chown=user backend/ ./backend/
|
| 25 |
|
| 26 |
# Copy built frontend from builder stage
|
| 27 |
+
COPY --chown=user --from=frontend-builder /app/frontend/dist ./frontend/dist
|
| 28 |
|
| 29 |
# Expose Hugging Face Space port
|
| 30 |
EXPOSE 7860
|