Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -10
Dockerfile
CHANGED
|
@@ -8,23 +8,27 @@ ENV HOME=/home/node \
|
|
| 8 |
# Set working directory inside node's home
|
| 9 |
WORKDIR $HOME/app
|
| 10 |
|
| 11 |
-
# Install unzip and
|
| 12 |
RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Copy zip
|
| 15 |
COPY --chown=node:node Archive.zip .
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
RUN unzip Archive.zip && rm Archive.zip && chown -R node:node $HOME/app
|
| 19 |
-
|
| 20 |
-
# Switch to the non-root node user
|
| 21 |
USER node
|
| 22 |
|
| 23 |
# Install dependencies
|
| 24 |
RUN npm install
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
CMD ["
|
|
|
|
| 8 |
# Set working directory inside node's home
|
| 9 |
WORKDIR $HOME/app
|
| 10 |
|
| 11 |
+
# Install unzip and clean apt cache
|
| 12 |
RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy project zip and extract it
|
| 15 |
COPY --chown=node:node Archive.zip .
|
| 16 |
+
RUN unzip Archive.zip && rm Archive.zip
|
| 17 |
|
| 18 |
+
# Switch to node user
|
|
|
|
|
|
|
|
|
|
| 19 |
USER node
|
| 20 |
|
| 21 |
# Install dependencies
|
| 22 |
RUN npm install
|
| 23 |
|
| 24 |
+
# Build the Vite app for production
|
| 25 |
+
RUN npm run build
|
| 26 |
+
|
| 27 |
+
# Install a lightweight HTTP server to serve dist/
|
| 28 |
+
RUN npm install -g serve
|
| 29 |
+
|
| 30 |
+
# Expose Hugging Face Spaces default port
|
| 31 |
+
EXPOSE 7860
|
| 32 |
|
| 33 |
+
# Serve the built files
|
| 34 |
+
CMD ["serve", "-s", "dist", "-l", "7860"]
|