From c6a9e24d51afb44c0a3d14cdd1a8aca7e6209933 Mon Sep 17 00:00:00 2001 From: valoomba Date: Fri, 26 Jul 2024 21:07:02 -0700 Subject: [PATCH] Update Dockerfile --- Dockerfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 347c01ee..b1d4dc17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# As a workaround we have to build on nodejs 18 +# nodejs 20 hangs on build with armv6/armv7 FROM docker.io/library/node:18-alpine AS build_node_modules # Update npm to latest @@ -11,7 +13,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. -FROM ghcr.io/vikashloomba/capmvm-k8s-os:1.23.5 +FROM docker.io/library/node:20-alpine HEALTHCHECK CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" --interval=1m --timeout=5s --retries=3 COPY --from=build_node_modules /app /app @@ -27,3 +29,21 @@ COPY --from=build_node_modules /node_modules /node_modules # Copy the needed wg-password scripts COPY --from=build_node_modules /app/wgpw.sh /bin/wgpw RUN chmod +x /bin/wgpw + +# Install Linux packages +RUN apk add --no-cache \ + dpkg \ + dumb-init \ + iptables \ + iptables-legacy \ + wireguard-tools + +# Use iptables-legacy +RUN update-alternatives --install /sbin/iptables iptables /sbin/iptables-legacy 10 --slave /sbin/iptables-restore iptables-restore /sbin/iptables-legacy-restore --slave /sbin/iptables-save iptables-save /sbin/iptables-legacy-save + +# Set Environment +ENV DEBUG=Server,WireGuard + +# Run Web UI +WORKDIR /app +CMD ["/usr/bin/dumb-init", "node", "server.js"]