-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (42 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#FROM bitnami/git:latest AS build_node_modules_source_code
#LABEL maintainer="[email protected]"
# Clone the wg-easy repository
#WORKDIR /
#RUN git clone https://github.com/wg-easy/wg-easy
FROM docker.io/library/node:18-alpine AS build_node_modules
LABEL maintainer="[email protected]"
# Copy Web UI
#COPY --from=build_node_modules_source_code /wg-easy/src/ /app/
COPY src/ /app/
WORKDIR /app
RUN npm install
RUN npm ci --production
FROM ubuntu:22.04
LABEL maintainer="[email protected]"
# Install necessary packages
RUN apt-get update
RUN apt-get install -y nodejs npm wget
COPY --from=build_node_modules /app /app
WORKDIR /app
RUN npm install
# Move node_modules one directory up
RUN mv /app/node_modules /node_modules
# Install necessary packages
RUN apt-get update && \
apt-get install -y \
iproute2 \
wireguard \
wireguard-tools \
dumb-init \
iptables && \
rm -rf /var/lib/apt/lists/*
# Enable this to run `npm run serve`
RUN npm i -g nodemon
# Expose Ports
EXPOSE 51820/udp
EXPOSE 51821/tcp
# Set Environment
ENV DEBUG=Server,WireGuard
# Run Web UI
WORKDIR /app
CMD ["/usr/bin/dumb-init", "node", "server.js"]