wg-easy/Dockerfile

38 lines
879 B
Docker
Raw Normal View History

2023-12-17 22:39:15 +01:00
FROM docker.io/library/node:20-alpine AS build_node_modules
2021-05-22 11:12:26 +02:00
2021-05-23 14:28:22 +02:00
# Copy Web UI
2021-05-23 12:02:56 +02:00
COPY src/ /app/
WORKDIR /app
RUN npm ci --production
2022-01-13 13:24:37 -08:00
# Copy build result to a new image.
# This saves a lot of disk space.
2023-12-17 22:39:15 +01:00
FROM docker.io/library/node:20-alpine
2022-01-13 13:24:37 -08:00
COPY --from=build_node_modules /app /app
# Move node_modules one directory up, so during development
# we don't have to mount it in a volume.
# This results in much faster reloading!
#
# Also, some node_modules might be native, and
# the architecture & OS of your development machine might differ
# than what runs inside of docker.
RUN mv /app/node_modules /node_modules
# Install Linux packages
RUN apk add -U --no-cache \
2023-12-17 22:42:40 +01:00
iptables \
2022-01-13 13:24:37 -08:00
wireguard-tools \
dumb-init
2021-05-23 12:02:56 +02:00
2021-05-23 14:28:22 +02:00
# Expose Ports
2021-05-23 12:02:56 +02:00
EXPOSE 51820/udp
2021-06-02 12:29:42 +02:00
EXPOSE 51821/tcp
2021-05-23 14:28:22 +02:00
# Set Environment
2021-05-23 12:02:56 +02:00
ENV DEBUG=Server,WireGuard
2021-05-23 14:28:22 +02:00
# Run Web UI
2022-01-13 13:24:37 -08:00
WORKDIR /app
CMD ["/usr/bin/dumb-init", "node", "server.js"]