Update Dockerfile
Browse files- Dockerfile +22 -23
Dockerfile
CHANGED
@@ -1,24 +1,14 @@
|
|
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
|
18 |
-
|
19 |
-
ffmpeg \
|
20 |
-
curl \
|
21 |
-
aria2 \
|
22 |
fonts-liberation \
|
23 |
libatk-bridge2.0-0 \
|
24 |
libatk1.0-0 \
|
@@ -38,20 +28,29 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
38 |
libasound2 \
|
39 |
libxkbcommon0 \
|
40 |
libxrandr2 \
|
41 |
-
xdg-utils
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
#
|
45 |
-
|
46 |
|
47 |
-
# Set permissions for the
|
48 |
-
RUN chown -R admin:admin /usr/src/app
|
|
|
49 |
|
50 |
-
# Switch to
|
51 |
USER admin
|
52 |
|
53 |
-
# Expose the application
|
54 |
EXPOSE 7860
|
55 |
|
56 |
-
# Define the
|
57 |
-
CMD
|
|
|
|
|
1 |
FROM mbonea/whats-ramsey:latest
|
2 |
|
3 |
# Create a non-root user
|
4 |
RUN useradd -ms /bin/bash admin
|
5 |
|
|
|
6 |
WORKDIR /usr/src/app
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Install necessary packages for Puppeteer
|
9 |
+
RUN apt-get update \
|
10 |
+
&& apt-get install -y --no-install-recommends \
|
11 |
+
wget ffmpeg curl aria2 \
|
|
|
|
|
12 |
fonts-liberation \
|
13 |
libatk-bridge2.0-0 \
|
14 |
libatk1.0-0 \
|
|
|
28 |
libasound2 \
|
29 |
libxkbcommon0 \
|
30 |
libxrandr2 \
|
31 |
+
xdg-utils
|
32 |
+
|
33 |
+
RUN npm install --no-cache
|
34 |
+
|
35 |
+
RUN npm install -g http-server
|
36 |
+
|
37 |
+
# Create the directory for whatsapp sessions and set permissions
|
38 |
+
RUN mkdir -p /usr/src/app/.wwebjs_auth/session-whatsapp_client
|
39 |
+
RUN chown -R admin:admin /usr/src/app/.wwebjs_auth
|
40 |
+
RUN chmod -R 777 /usr/src/app/.wwebjs_auth
|
41 |
|
42 |
+
# Copy the application code
|
43 |
+
COPY --chown=admin . /usr/src/app
|
44 |
|
45 |
+
# Set permissions for the entire app directory
|
46 |
+
RUN chown -R admin:admin /usr/src/app
|
47 |
+
RUN chmod -R 755 /usr/src/app
|
48 |
|
49 |
+
# Switch to admin user
|
50 |
USER admin
|
51 |
|
52 |
+
# Expose the port your application runs on
|
53 |
EXPOSE 7860
|
54 |
|
55 |
+
# Define the command to run the start script
|
56 |
+
CMD npm start
|