Spaces:
Sleeping
Sleeping
Fix: Remove duplicate UID 1000 user creation, use existing node user
Browse files- Dockerfile +10 -13
Dockerfile
CHANGED
|
@@ -10,34 +10,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 10 |
python3-venv \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Create user with UID 1000 (required by HF Spaces)
|
| 14 |
-
RUN useradd -m -u 1000 user
|
| 15 |
-
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
# Copy and build frontend
|
| 19 |
-
COPY
|
| 20 |
RUN cd frontend && npm ci
|
| 21 |
-
COPY
|
| 22 |
RUN cd frontend && npm run build
|
| 23 |
|
| 24 |
# Copy and install backend
|
| 25 |
-
COPY
|
| 26 |
RUN pip3 install --no-cache-dir --break-system-packages \
|
| 27 |
fastapi uvicorn pydantic pydantic-settings \
|
| 28 |
httpx psutil python-dotenv websockets
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
-
ENV HOME=/home/
|
| 34 |
PYTHONPATH=/app/backend \
|
| 35 |
PYTHONUNBUFFERED=1
|
| 36 |
|
| 37 |
EXPOSE 7860
|
| 38 |
|
| 39 |
-
# Simple startup script
|
| 40 |
-
COPY --chown=user start.sh /app/
|
| 41 |
-
RUN chmod +x /app/start.sh
|
| 42 |
-
|
| 43 |
CMD ["/app/start.sh"]
|
|
|
|
| 10 |
python3-venv \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
# Copy and build frontend
|
| 16 |
+
COPY frontend/package*.json ./frontend/
|
| 17 |
RUN cd frontend && npm ci
|
| 18 |
+
COPY frontend/ ./frontend/
|
| 19 |
RUN cd frontend && npm run build
|
| 20 |
|
| 21 |
# Copy and install backend
|
| 22 |
+
COPY backend/ ./backend/
|
| 23 |
RUN pip3 install --no-cache-dir --break-system-packages \
|
| 24 |
fastapi uvicorn pydantic pydantic-settings \
|
| 25 |
httpx psutil python-dotenv websockets
|
| 26 |
|
| 27 |
+
# Simple startup script
|
| 28 |
+
COPY start.sh /app/
|
| 29 |
+
RUN chmod +x /app/start.sh
|
| 30 |
+
|
| 31 |
+
# Switch to node user (UID 1000 already exists in node image)
|
| 32 |
+
USER node
|
| 33 |
|
| 34 |
+
ENV HOME=/home/node \
|
| 35 |
PYTHONPATH=/app/backend \
|
| 36 |
PYTHONUNBUFFERED=1
|
| 37 |
|
| 38 |
EXPOSE 7860
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
CMD ["/app/start.sh"]
|