2024-08-23 06:15:39 +02:00
|
|
|
# Pull from small Debian stable image.
|
2024-08-25 03:02:34 +02:00
|
|
|
FROM alpine:latest AS builder
|
|
|
|
|
2024-08-23 06:15:39 +02:00
|
|
|
LABEL maintainer="dselen@nerthus.nl"
|
|
|
|
|
2024-08-23 23:49:54 +02:00
|
|
|
WORKDIR /opt/wireguarddashboard/src
|
2024-08-25 03:02:34 +02:00
|
|
|
|
2024-08-23 06:15:39 +02:00
|
|
|
RUN apk update && \
|
2024-08-25 03:02:34 +02:00
|
|
|
apk add --no-cache sudo gcc musl-dev rust cargo linux-headers
|
|
|
|
|
|
|
|
COPY ./docker/alpine/builder.sh /opt/wireguarddashboard/src/
|
|
|
|
COPY ./docker/alpine/requirements.txt /opt/wireguarddashboard/src/
|
|
|
|
RUN chmod u+x /opt/wireguarddashboard/src/builder.sh
|
|
|
|
RUN /opt/wireguarddashboard/src/builder.sh
|
|
|
|
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /opt/wireguarddashboard/src
|
2024-08-24 13:45:13 +02:00
|
|
|
|
2024-08-23 23:49:54 +02:00
|
|
|
COPY ./src /opt/wireguarddashboard/src/
|
2024-08-25 03:02:34 +02:00
|
|
|
COPY --from=builder /opt/wireguarddashboard/src/venv /opt/wireguarddashboard/src/venv
|
|
|
|
COPY --from=builder /opt/wireguarddashboard/src/log /opt/wireguarddashboard/src/log/
|
2024-08-24 13:45:13 +02:00
|
|
|
COPY ./docker/alpine/entrypoint.sh /opt/wireguarddashboard/src/
|
2024-08-25 03:02:34 +02:00
|
|
|
COPY ./docker/alpine/wgd.sh /opt/wireguarddashboard/src/
|
2024-08-23 06:15:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-25 03:02:34 +02:00
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache wireguard-tools sudo && \
|
|
|
|
apk add --no-cache iptables ip6tables && \
|
|
|
|
chmod u+x /opt/wireguarddashboard/src/entrypoint.sh
|
|
|
|
|
2024-08-23 06:15:39 +02:00
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:10086/signin || exit 1
|
|
|
|
|
2024-08-23 23:49:54 +02:00
|
|
|
ENTRYPOINT ["/opt/wireguarddashboard/src/entrypoint.sh"]
|