deepak191z commited on
Commit
829f956
·
verified ·
1 Parent(s): d6fa5a1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:20
2
 
3
  # Create a non-root user
4
  RUN groupadd -r appuser && useradd -r -g appuser appuser
@@ -10,22 +10,19 @@ WORKDIR /usr/src/app
10
  COPY package*.json ./
11
  RUN npm install
12
 
13
-
14
-
15
- # If building for production, use:
16
- # RUN npm ci --only=production
17
 
18
  # Copy application source code
19
  COPY . .
20
 
21
- # Change ownership of the app directory to the non-root user
22
- RUN chown -R appuser:appuser /usr/src/app
23
- RUN npx playwright install --with-deps
24
- # Switch to the non-root user
25
  USER appuser
26
 
27
- # Expose the desired port (optional, based on your server.js configuration)
28
  EXPOSE 7860
29
 
30
- # Set the default command to start the server
31
  CMD ["node", "server.js"]
 
1
+ FROM node:20
2
 
3
  # Create a non-root user
4
  RUN groupadd -r appuser && useradd -r -g appuser appuser
 
10
  COPY package*.json ./
11
  RUN npm install
12
 
13
+ # Install Playwright and ensure proper ownership
14
+ RUN npx playwright install --with-deps && \
15
+ mkdir -p /home/appuser/.cache/ms-playwright && \
16
+ chown -R appuser:appuser /home/appuser/.cache/ms-playwright /usr/src/app
17
 
18
  # Copy application source code
19
  COPY . .
20
 
21
+ # Switch to non-root user
 
 
 
22
  USER appuser
23
 
24
+ # Expose the desired port
25
  EXPOSE 7860
26
 
27
+ # Start the server
28
  CMD ["node", "server.js"]