Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -4
Dockerfile
CHANGED
@@ -1,12 +1,29 @@
|
|
1 |
-
|
|
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
|
6 |
-
COPY package
|
7 |
|
|
|
8 |
RUN npm install
|
9 |
|
|
|
10 |
COPY . .
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Node.js image as the base image
|
2 |
+
FROM node:18-alpine
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy package.json and package-lock.json
|
8 |
+
COPY package*.json ./
|
9 |
|
10 |
+
# Install dependencies
|
11 |
RUN npm install
|
12 |
|
13 |
+
# Copy the rest of the application code
|
14 |
COPY . .
|
15 |
|
16 |
+
# Ensure the correct ownership and permissions
|
17 |
+
RUN chown -R node:node /app
|
18 |
+
|
19 |
+
# Switch to the non-root 'user' user
|
20 |
+
USER node
|
21 |
+
|
22 |
+
# Expose the port the app runs on
|
23 |
+
EXPOSE 7860
|
24 |
+
|
25 |
+
# Set environment variable to disable opening browser
|
26 |
+
ENV BROWSER=none
|
27 |
+
|
28 |
+
# Start the Vite development server with specific configurations
|
29 |
+
CMD ["npm", "run", "dev", "--", "--host", "--port", "7860", "--strictPort"]
|