25 lines
531 B
Docker
25 lines
531 B
Docker
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache \
|
|
wireguard-tools \
|
|
iptables \
|
|
ip6tables \
|
|
bash \
|
|
curl \
|
|
iputils-ping \
|
|
iproute2 \
|
|
openresolv
|
|
|
|
# Create wireguard config directory (config is mounted at runtime)
|
|
RUN mkdir -p /etc/wireguard
|
|
|
|
# Copy entrypoint
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Health check: can we reach the internet through the VPN?
|
|
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
|
CMD ping -c 1 -W 5 1.1.1.1 || exit 1
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|