mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Finished work for now on the alpine docker image.
This commit is contained in:
parent
2ec3ee2734
commit
40f39e918d
@ -13,11 +13,11 @@ ENV global_dns="1.1.1.1"
|
||||
ENV enable="none"
|
||||
ENV isolate="wg0"
|
||||
ENV public_ip="0.0.0.0"
|
||||
ENV update="yes"
|
||||
|
||||
# Doing package management operations, such as upgrading
|
||||
RUN apk update \
|
||||
&& apk add --no-cache bash git curl tzdata \
|
||||
&& apk add --no-cache bash git tzdata \
|
||||
iptables ip6tables curl openrc wireguard-tools \
|
||||
sudo py3-psutil py3-bcrypt
|
||||
|
||||
# Using WGDASH -- like wg_net functionally as a ARG command. But it is needed in entrypoint.sh so it needs to be exported as environment variable.
|
||||
@ -49,8 +49,8 @@ RUN echo "[Interface]" > /setup/conf/wg0.conf \
|
||||
&& echo "DNS = ${global_dns}" >> /setup/conf/wg0.conf
|
||||
|
||||
# Defining a way for Docker to check the health of the container. In this case: checking the login URL.
|
||||
HEALTHCHECK --interval=2m --timeout=1m --start-period=20s --retries=3 \
|
||||
CMD [ "$(curl -s -o /dev/null -w '%{http_code}' http://localhost:10086/)" -eq "200" ] || exit 1
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD sh -c 'pgrep gunicorn > /dev/null && pgrep tail > /dev/null' || exit 1
|
||||
|
||||
|
||||
# Copy the basic entrypoint.sh script.
|
||||
|
@ -1,6 +1,6 @@
|
||||
services:
|
||||
wireguard-dashboard:
|
||||
image: dselen/wgdashboard:dev
|
||||
image: dselen:alpine
|
||||
restart: unless-stopped
|
||||
container_name: wgdashboard
|
||||
environment:
|
||||
|
15
src/wgd.sh
15
src/wgd.sh
@ -90,7 +90,7 @@ _installPython(){
|
||||
fi
|
||||
;;
|
||||
alpine)
|
||||
{ sudo apk update; sudo apk add python3 net-tools; printf "\n\n"; } >> ./log/install.txt
|
||||
{ sudo apk update; sudo apk add python3 net-tools --no-cache; printf "\n\n"; } >> ./log/install.txt
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -174,7 +174,7 @@ _installPythonPip(){
|
||||
fi
|
||||
;;
|
||||
alpine)
|
||||
{ sudo apk update; sudo apk add py3-pip ; printf "\n\n"; } >> ./log/install.txt
|
||||
{ sudo apk update; sudo apk add py3-pip --no-cache; printf "\n\n"; } >> ./log/install.txt
|
||||
;;
|
||||
*)
|
||||
printf "[WGDashboard] %s Sorry, your OS is not supported. Currently the install script only support Debian-based, Red Hat-based OS. With experimental support for Alpine Linux.\n" "$heavy_crossmark"
|
||||
@ -195,26 +195,25 @@ _installPythonPip(){
|
||||
}
|
||||
|
||||
_checkWireguard(){
|
||||
# Check if wg and wg-quick are installed
|
||||
if ! command -v wg > /dev/null 2>&1 || ! command -v wg-quick > /dev/null 2>&1
|
||||
then
|
||||
case "$OS" in
|
||||
ubuntu|debian)
|
||||
{
|
||||
sudo apt update && sudo apt-get install -y wireguard;
|
||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
||||
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||
} &>> ./log/install.txt
|
||||
;;
|
||||
centos|fedora|redhat|rhel)
|
||||
{
|
||||
sudo dnf install -y wireguard-tools;
|
||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
||||
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||
} &>> ./log/install.txt
|
||||
;;
|
||||
alpine)
|
||||
{
|
||||
sudo apk update && sudo apk add wireguard-tools;
|
||||
printf "\nWireGuard installed on %s.\n\n" "$OS";
|
||||
sudo apk update && sudo apk add wireguard-tools --no-cache;
|
||||
printf "\n[WGDashboard] WireGuard installed on %s.\n\n" "$OS";
|
||||
} &>> ./log/install.txt
|
||||
;;
|
||||
*)
|
||||
@ -224,7 +223,7 @@ _checkWireguard(){
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "WireGuard is already installed.\n"
|
||||
printf "[WGDashboard] WireGuard is already installed.\n"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user