jakubrada commited on
Commit
7768138
·
verified ·
1 Parent(s): 0b5ade3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,12 +1,29 @@
1
- FROM node:18
 
2
 
 
3
  WORKDIR /app
4
 
5
- COPY package.json package.json
6
- COPY package-lock.json package-lock.json
7
 
 
8
  RUN npm install
9
 
 
10
  COPY . .
11
 
12
- CMD ["npm", "run", "dev"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]