Spaces:
Build error
Build error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:18-slim
|
| 2 |
+
|
| 3 |
+
# Use the existing node user (UID 1000)
|
| 4 |
+
USER node
|
| 5 |
+
|
| 6 |
+
# Set environment variables
|
| 7 |
+
ENV HOME=/home/node \
|
| 8 |
+
PATH=/home/node/.local/bin:$PATH
|
| 9 |
+
|
| 10 |
+
# Set working directory
|
| 11 |
+
WORKDIR /home/node/app
|
| 12 |
+
|
| 13 |
+
# Copy package files with proper ownership
|
| 14 |
+
COPY --chown=node:node package*.json ./
|
| 15 |
+
|
| 16 |
+
# Install dependencies
|
| 17 |
+
RUN npm install
|
| 18 |
+
|
| 19 |
+
# Copy rest of the application with proper ownership
|
| 20 |
+
COPY --chown=node:node . .
|
| 21 |
+
|
| 22 |
+
# Build the Next.js app
|
| 23 |
+
RUN npm run build
|
| 24 |
+
|
| 25 |
+
# Expose port 7860
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# Start the application on port 7860
|
| 29 |
+
CMD ["npm", "start", "--", "-p", "7860"]
|