Fix: iptables cannot be executed correctly on certain environments (#690)

This commit is contained in:
Philip H 2023-12-21 21:24:07 +01:00 committed by GitHub
commit d46c11954b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -3,6 +3,10 @@
FROM docker.io/library/node:18-alpine AS build_node_modules FROM docker.io/library/node:18-alpine AS build_node_modules
# Hide fund and update-notifier message
RUN npm config set -g fund false &&\
npm config set -g update-notifier false
# Copy Web UI # Copy Web UI
COPY src/ /app/ COPY src/ /app/
WORKDIR /app WORKDIR /app
@ -11,6 +15,10 @@ RUN npm ci
# This saves a lot of disk space. # This saves a lot of disk space.
FROM docker.io/library/node:18-alpine FROM docker.io/library/node:18-alpine
# Hide fund and update-notifier message
RUN npm config set -g fund false &&\
npm config set -g update-notifier false
COPY --from=build_node_modules /app /app COPY --from=build_node_modules /app /app
# Move node_modules one directory up, so during development # Move node_modules one directory up, so during development
@ -27,9 +35,14 @@ RUN npm i -g nodemon
# Install Linux packages # Install Linux packages
RUN apk add -U --no-cache \ RUN apk add -U --no-cache \
dpkg \
dumb-init \
iptables \ iptables \
wireguard-tools \ iptables-legacy \
dumb-init wireguard-tools
# Symlink iptables
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
# Expose Ports # Expose Ports
EXPOSE 51820/udp EXPOSE 51820/udp