Skip to content

Commit aa9a3e1

Browse files
committed
new: updated docker build process to use nodejs debian/ubuntu repos
1 parent da9515f commit aa9a3e1

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

‎deploy/docker/Dockerfile

+27-8
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ CMD [ "sh" , "/lowcoder/api-service/entrypoint.sh" ]
6666
##
6767
FROM ubuntu:jammy as build-node-service
6868

69-
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates build-essential
69+
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates build-essential gnupg
70+
71+
# Add nodejs repo and keys
72+
RUN mkdir -p /etc/apt/keyrings \
73+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
74+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
7075

7176
# Download nodejs and install yarn
72-
RUN curl -sL https://deb.nodesource.com/setup_19.x | bash - \
73-
&& apt-get install --no-install-recommends -y nodejs \
74-
&& npm install -g yarn
77+
RUN apt-get update \
78+
&& apt-get install --no-install-recommends -y nodejs \
79+
&& npm install -g yarn
7580

7681
# Copy and build the node-service app
7782
COPY server/node-service/ /lowcoder/node-service/app/
@@ -93,9 +98,16 @@ RUN chmod +x /lowcoder/node-service/*.sh
9398
FROM ubuntu:jammy as lowcoder-ce-node-service
9499
LABEL maintainer="lowcoder"
95100

96-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates \
97-
&& curl -sL https://deb.nodesource.com/setup_19.x | bash - \
98-
&& apt-get install --no-install-recommends -y nodejs gosu \
101+
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates gnupg
102+
103+
# Add nodejs repo and keys
104+
RUN mkdir -p /etc/apt/keyrings \
105+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
106+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
107+
108+
# Download nodejs and install yarn
109+
RUN apt-get update \
110+
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y nodejs gosu \
99111
&& npm install -g yarn \
100112
&& rm -rf /var/cache/apt/lists \
101113
&& addgroup --system --gid 9001 lowcoder \
@@ -167,13 +179,20 @@ EXPOSE 3443
167179
FROM lowcoder-ce-frontend
168180
LABEL maintainer="lowcoder"
169181

182+
RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y curl ca-certificates gnupg
183+
184+
# Add nodejs repo and keys
185+
RUN mkdir -p /etc/apt/keyrings \
186+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
187+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
188+
189+
170190
# Install required packages
171191
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y bash gnupg curl lsb-release \
172192
&& curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg \
173193
&& echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb bullseye main" | tee /etc/apt/sources.list.d/redis.list \
174194
&& curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-archive-keyring.gpg \
175195
&& echo "deb [signed-by=/usr/share/keyrings/mongodb-archive-keyring.gpg arch=amd64,arm64] http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
176-
&& curl -sL https://deb.nodesource.com/setup_19.x | bash - \
177196
&& if [ "$(dpkg --print-architecture)" = "amd64" ] || [ "$(dpkg --print-architecture)" = "i386" ]; then \
178197
curl -sL http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_$(dpkg --print-architecture).deb --output libssl1.1_1.1.1f-1ubuntu2_$(dpkg --print-architecture).deb; \
179198
else \

0 commit comments

Comments
 (0)