Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +10 -4
Dockerfile
CHANGED
|
@@ -2,19 +2,25 @@ FROM node:18
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install unzip
|
| 6 |
RUN apt-get update && apt-get install -y unzip
|
| 7 |
|
| 8 |
# Copy your zip file
|
| 9 |
COPY Archive.zip /app/
|
| 10 |
|
| 11 |
-
# Unzip and remove
|
| 12 |
RUN unzip Archive.zip && rm Archive.zip
|
| 13 |
|
| 14 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
RUN npm install
|
| 16 |
|
| 17 |
-
# Expose
|
| 18 |
EXPOSE 3000
|
| 19 |
|
| 20 |
# Start the app
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install unzip and any needed utilities
|
| 6 |
RUN apt-get update && apt-get install -y unzip
|
| 7 |
|
| 8 |
# Copy your zip file
|
| 9 |
COPY Archive.zip /app/
|
| 10 |
|
| 11 |
+
# Unzip and remove archive
|
| 12 |
RUN unzip Archive.zip && rm Archive.zip
|
| 13 |
|
| 14 |
+
# Make sure the app directory is owned by node user (safer than root)
|
| 15 |
+
RUN chown -R node:node /app
|
| 16 |
+
|
| 17 |
+
# Switch to non-root user for better security and permission handling
|
| 18 |
+
USER node
|
| 19 |
+
|
| 20 |
+
# Install dependencies as node user
|
| 21 |
RUN npm install
|
| 22 |
|
| 23 |
+
# Expose port (adjust if needed)
|
| 24 |
EXPOSE 3000
|
| 25 |
|
| 26 |
# Start the app
|