Update Dockerfile
Browse files- Dockerfile +10 -12
Dockerfile
CHANGED
|
@@ -1,27 +1,25 @@
|
|
| 1 |
FROM node:18-slim
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
# Set
|
| 10 |
-
ENV HOME=/home/user \
|
| 11 |
-
PATH=/home/user/.local/bin:$PATH
|
| 12 |
-
|
| 13 |
-
# Set the working directory to the user's home directory
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
| 16 |
# Copy package files with proper ownership
|
| 17 |
-
COPY --chown=
|
| 18 |
|
| 19 |
# Install dependencies
|
| 20 |
RUN npm install
|
| 21 |
|
| 22 |
# Copy application files with proper ownership
|
| 23 |
-
COPY --chown=
|
| 24 |
-
COPY --chown=
|
| 25 |
|
| 26 |
# Expose port 7860 (HF Spaces default)
|
| 27 |
EXPOSE 7860
|
|
|
|
| 1 |
FROM node:18-slim
|
| 2 |
|
| 3 |
+
# The node:18-slim image already has a user with UID 1000 (node)
|
| 4 |
+
# We'll use that user instead of creating a new one
|
| 5 |
+
USER node
|
| 6 |
|
| 7 |
+
# Set home to the node user's home directory
|
| 8 |
+
ENV HOME=/home/node \
|
| 9 |
+
PATH=/home/node/.local/bin:$PATH
|
| 10 |
|
| 11 |
+
# Set the working directory
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
WORKDIR $HOME/app
|
| 13 |
|
| 14 |
# Copy package files with proper ownership
|
| 15 |
+
COPY --chown=node package*.json ./
|
| 16 |
|
| 17 |
# Install dependencies
|
| 18 |
RUN npm install
|
| 19 |
|
| 20 |
# Copy application files with proper ownership
|
| 21 |
+
COPY --chown=node proxy.js ./
|
| 22 |
+
COPY --chown=node README.md ./
|
| 23 |
|
| 24 |
# Expose port 7860 (HF Spaces default)
|
| 25 |
EXPOSE 7860
|