Spaces:
Running
Running
update
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -18,6 +18,14 @@ RUN npm run build
|
|
| 18 |
# Stage 2: Production image
|
| 19 |
FROM python:3.11-slim
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# Set up a new user named "user" with user ID 1000
|
| 22 |
RUN useradd -m -u 1000 user
|
| 23 |
|
|
@@ -49,13 +57,6 @@ COPY --chown=user:user --from=frontend-builder /build/package*.json ./frontend/
|
|
| 49 |
COPY --chown=user:user --from=frontend-builder /build/next.config.js ./frontend/
|
| 50 |
COPY --chown=user:user --from=frontend-builder /build/node_modules ./frontend/node_modules
|
| 51 |
|
| 52 |
-
# Install Node.js for running frontend
|
| 53 |
-
USER root
|
| 54 |
-
RUN apt-get update && \
|
| 55 |
-
apt-get install -y --no-install-recommends nodejs npm && \
|
| 56 |
-
rm -rf /var/lib/apt/lists/*
|
| 57 |
-
USER user
|
| 58 |
-
|
| 59 |
# Set environment variables for the application
|
| 60 |
ENV BACKEND_HOST=http://localhost:8000 \
|
| 61 |
PORT=7860
|
|
|
|
| 18 |
# Stage 2: Production image
|
| 19 |
FROM python:3.11-slim
|
| 20 |
|
| 21 |
+
# Install system dependencies as root (git for pip, nodejs for frontend)
|
| 22 |
+
RUN apt-get update && \
|
| 23 |
+
apt-get install -y --no-install-recommends \
|
| 24 |
+
git \
|
| 25 |
+
nodejs \
|
| 26 |
+
npm \
|
| 27 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
+
|
| 29 |
# Set up a new user named "user" with user ID 1000
|
| 30 |
RUN useradd -m -u 1000 user
|
| 31 |
|
|
|
|
| 57 |
COPY --chown=user:user --from=frontend-builder /build/next.config.js ./frontend/
|
| 58 |
COPY --chown=user:user --from=frontend-builder /build/node_modules ./frontend/node_modules
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
# Set environment variables for the application
|
| 61 |
ENV BACKEND_HOST=http://localhost:8000 \
|
| 62 |
PORT=7860
|