Yakova commited on
Commit
8252b88
·
verified ·
1 Parent(s): 039d971

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -56
Dockerfile CHANGED
@@ -1,71 +1,57 @@
 
1
  FROM mbonea/whats-ramsey:latest
2
 
3
  # Create a non-root user
4
  RUN useradd -ms /bin/bash admin
5
 
6
-
7
- WORKDIR /usr/src/app
8
-
9
  # Set the working directory
 
10
 
 
 
11
 
12
-
13
  RUN npm install --no-cache
14
 
15
-
16
-
17
  # Install necessary packages for Puppeteer
18
- RUN apt-get update \
19
- && apt-get install -y --no-install-recommends \
20
- wget ffmpeg curl aria2 \
21
- fonts-liberation \
22
- libatk-bridge2.0-0 \
23
- libatk1.0-0 \
24
- libatspi2.0-0 \
25
- libcups2 \
26
- libdrm2 \
27
- libgbm1 \
28
- libgtk-3-0 \
29
- libnspr4 \
30
- libnss3 \
31
- libu2f-udev \
32
- libvulkan1 \
33
- libxcomposite1 \
34
- libxdamage1 \
35
- mesa-vulkan-drivers \
36
- libxfixes3 \
37
- libasound2 \
38
- libxkbcommon0 \
39
- libxrandr2 \
40
- xdg-utils
41
-
42
-
43
-
44
- # RUN npx playwright install
45
- # If your application requires any environment variables, set them here
46
- # ENV NODE_ENV=production
47
-
48
-
49
-
50
- RUN npm install -g http-server
51
- # Copy the application code
52
- COPY --chown=admin . /usr/src/app
53
-
54
-
55
-
56
-
57
-
58
-
59
- # Give read and write permissions to the admin user
60
-
61
- RUN chown -R admin:admin /usr/src/app
62
- RUN chmod 777 /usr/src/app
63
  USER admin
64
 
65
-
66
- # Expose the port your application runs on
67
  EXPOSE 7860
68
 
69
- # Define the command to run the start script
70
- CMD npm start
71
-
 
1
+ # Base image
2
  FROM mbonea/whats-ramsey:latest
3
 
4
  # Create a non-root user
5
  RUN useradd -ms /bin/bash admin
6
 
 
 
 
7
  # Set the working directory
8
+ WORKDIR /usr/src/app
9
 
10
+ # Copy the application code and set ownership to the non-root user
11
+ COPY --chown=admin:admin . /usr/src/app
12
 
13
+ # Install dependencies
14
  RUN npm install --no-cache
15
 
 
 
16
  # Install necessary packages for Puppeteer
17
+ RUN apt-get update && apt-get install -y --no-install-recommends \
18
+ wget \
19
+ ffmpeg \
20
+ curl \
21
+ aria2 \
22
+ fonts-liberation \
23
+ libatk-bridge2.0-0 \
24
+ libatk1.0-0 \
25
+ libatspi2.0-0 \
26
+ libcups2 \
27
+ libdrm2 \
28
+ libgbm1 \
29
+ libgtk-3-0 \
30
+ libnspr4 \
31
+ libnss3 \
32
+ libu2f-udev \
33
+ libvulkan1 \
34
+ libxcomposite1 \
35
+ libxdamage1 \
36
+ mesa-vulkan-drivers \
37
+ libxfixes3 \
38
+ libasound2 \
39
+ libxkbcommon0 \
40
+ libxrandr2 \
41
+ xdg-utils \
42
+ && rm -rf /var/lib/apt/lists/*
43
+
44
+ # Optional: If your application requires Playwright, uncomment the next line
45
+ # RUN npx playwright install
46
+
47
+ # Set permissions for the application directory
48
+ RUN chown -R admin:admin /usr/src/app && chmod -R 755 /usr/src/app
49
+
50
+ # Switch to the non-root user
 
 
 
 
 
 
 
 
 
 
 
51
  USER admin
52
 
53
+ # Expose the application port
 
54
  EXPOSE 7860
55
 
56
+ # Define the default command
57
+ CMD ["npm", "start"]