Update Dockerfile
Browse files- Dockerfile +32 -12
Dockerfile
CHANGED
@@ -1,18 +1,38 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
COPY . .
|
6 |
|
7 |
-
|
8 |
-
|
|
|
9 |
|
10 |
-
#
|
11 |
-
RUN mkdir /.npm && chown -R 1000:0 "/.npm" && chown -R 1000:0 "./" && chmod -R 755 "./" \
|
12 |
-
&& mkdir /.cache && chown -R 1000:0 "/.cache"
|
13 |
|
14 |
-
|
15 |
-
EXPOSE 7860
|
16 |
-
RUN ls /test
|
17 |
-
# 启动APP
|
18 |
-
CMD ["sh", "./initApplication.sh"]
|
|
|
1 |
+
# Use the official Node.js 16 image as the base image
|
2 |
+
FROM node:16
|
3 |
+
RUN chmod 1777 /tmp
|
4 |
+
# Install necessary dependencies for running Chrome
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
wget \
|
7 |
+
gnupg \
|
8 |
+
ca-certificates \
|
9 |
+
apt-transport-https \
|
10 |
+
xvfb \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
+
# Install Google Chrome
|
14 |
+
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
15 |
+
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \
|
16 |
+
&& apt-get update \
|
17 |
+
&& apt-get install -y google-chrome-stable \
|
18 |
+
&& rm -rf /var/lib/apt/lists/*
|
19 |
|
20 |
+
# Set up the working directory in the container
|
21 |
+
WORKDIR /app
|
22 |
+
|
23 |
+
# Copy package.json and package-lock.json to the working directory
|
24 |
+
COPY package*.json ./
|
25 |
+
|
26 |
+
# Install Node.js dependencies
|
27 |
+
RUN npm install
|
28 |
+
|
29 |
+
# Copy the rest of the application code
|
30 |
COPY . .
|
31 |
|
32 |
+
# Expose the port your app runs on
|
33 |
+
EXPOSE 8080
|
34 |
+
RUN export PASSWORD=$PASS && echo $B64JS | base64 -d > config.mjs
|
35 |
|
36 |
+
# Command to run the application
|
|
|
|
|
37 |
|
38 |
+
CMD [ "node", "index.mjs" ]
|
|
|
|
|
|
|
|