Epikcoder
commited on
Commit
·
b7c0ae9
1
Parent(s):
c7d3810
varo gendeng
Browse files- Dockerfile +20 -76
Dockerfile
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
# Use
|
2 |
-
FROM node:20-
|
3 |
|
4 |
# Set the working directory
|
5 |
WORKDIR /app
|
@@ -7,90 +7,34 @@ WORKDIR /app
|
|
7 |
# Copy the application files to the container
|
8 |
COPY . /app
|
9 |
|
10 |
-
# Set locale environment variables
|
11 |
-
ENV LANG en_US.UTF-8
|
12 |
-
ENV LANGUAGE en_US:en
|
13 |
-
ENV LC_ALL en_US.UTF-8
|
14 |
-
|
15 |
-
# Install glibc for compatibility with applications requiring it
|
16 |
-
ENV GLIBC_REPO=https://github.com/sgerrand/alpine-pkg-glibc
|
17 |
-
ENV GLIBC_VERSION=2.34-r0
|
18 |
-
RUN set -ex && \
|
19 |
-
apk --no-cache add libstdc++ curl ca-certificates && \
|
20 |
-
curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk -o /tmp/glibc.apk && \
|
21 |
-
curl -sSL ${GLIBC_REPO}/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk -o /tmp/glibc-bin.apk && \
|
22 |
-
apk add --no-cache --allow-untrusted /tmp/glibc.apk /tmp/glibc-bin.apk && \
|
23 |
-
rm -rf /tmp/*.apk && \
|
24 |
-
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib
|
25 |
-
|
26 |
# Install prerequisites and helper packages
|
27 |
-
RUN
|
28 |
bash \
|
29 |
dpkg \
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
atk \
|
36 |
-
at-spi2-atk \
|
37 |
-
expat \
|
38 |
-
glib \
|
39 |
-
gtk+3.0 \
|
40 |
-
libdrm \
|
41 |
-
libx11 \
|
42 |
-
libxcomposite \
|
43 |
-
libxcursor \
|
44 |
-
libxdamage \
|
45 |
-
libxext \
|
46 |
-
libxi \
|
47 |
-
libxrandr \
|
48 |
-
libxscrnsaver \
|
49 |
-
libxshmfence \
|
50 |
-
libxtst \
|
51 |
-
mesa-gbm \
|
52 |
-
nss \
|
53 |
-
pango && \
|
54 |
-
curl -SL https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /google-chrome-stable_current_amd64.deb && \
|
55 |
-
dpkg -x /google-chrome-stable_current_amd64.deb google-chrome-stable && \
|
56 |
-
mv /google-chrome-stable/usr/bin/* /usr/bin && \
|
57 |
-
mv /google-chrome-stable/usr/share/* /usr/share && \
|
58 |
-
mv /google-chrome-stable/etc/* /etc && \
|
59 |
-
mv /google-chrome-stable/opt/* /opt && \
|
60 |
-
rm -r /google-chrome-stable
|
61 |
-
|
62 |
-
# Install additional packages
|
63 |
-
RUN apk add --no-cache \
|
64 |
-
font-noto \
|
65 |
-
font-noto-cjk \
|
66 |
-
font-noto-extra \
|
67 |
gcompat \
|
68 |
libstdc++ \
|
69 |
-
|
70 |
-
|
71 |
-
build-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
imagemagick \
|
76 |
-
|
77 |
-
giflib-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
harfbuzz \
|
83 |
-
ttf-freefont
|
84 |
-
|
85 |
-
# Set the Puppeteer executable path environment variable (if needed)
|
86 |
-
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
87 |
|
88 |
# Install Node.js dependencies
|
89 |
RUN npm install
|
90 |
|
91 |
-
# Link the resolver library (if needed)
|
92 |
-
RUN ln -s /lib/libresolv.so.2 /usr/lib/libresolv.so.2
|
93 |
-
|
94 |
# Expose the application port
|
95 |
EXPOSE 7860
|
96 |
|
|
|
1 |
+
# Use a Debian-based Node.js image
|
2 |
+
FROM node:20-buster
|
3 |
|
4 |
# Set the working directory
|
5 |
WORKDIR /app
|
|
|
7 |
# Copy the application files to the container
|
8 |
COPY . /app
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# Install prerequisites and helper packages
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
bash \
|
13 |
dpkg \
|
14 |
+
x11-apps \
|
15 |
+
libnss3 \
|
16 |
+
fonts-noto \
|
17 |
+
fonts-noto-cjk \
|
18 |
+
fonts-noto-extra \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
gcompat \
|
20 |
libstdc++ \
|
21 |
+
libuuid1 \
|
22 |
+
libvips-dev \
|
23 |
+
build-essential \
|
24 |
+
libjpeg-dev \
|
25 |
+
libpango1.0-dev \
|
26 |
+
libcairo2-dev \
|
27 |
imagemagick \
|
28 |
+
libssl1.1 \
|
29 |
+
giflib-tools \
|
30 |
+
librsvg2-dev \
|
31 |
+
chromium \
|
32 |
+
&& apt-get clean \
|
33 |
+
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
# Install Node.js dependencies
|
36 |
RUN npm install
|
37 |
|
|
|
|
|
|
|
38 |
# Expose the application port
|
39 |
EXPOSE 7860
|
40 |
|