mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-09-20 07:16:25 +08:00
Merge 1c267b732b
into a97a91b844
This commit is contained in:
commit
16db3adb12
29
src/Dockerfile
Executable file
29
src/Dockerfile
Executable file
|
@ -0,0 +1,29 @@
|
|||
FROM python:3.10.2-alpine3.15 as base
|
||||
|
||||
|
||||
RUN apk --update-cache upgrade && apk add --no-cache gcc g++ libffi-dev jpeg-dev zlib-dev libjpeg wireguard-tools iptables ip6tables inotify-tools \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN mkdir -p /etc/wireguard/
|
||||
|
||||
# configure wireguard
|
||||
RUN wg genkey | tee /etc/wireguard/privatekey | wg pubkey | tee /etc/wireguard/publick
|
||||
|
||||
|
||||
|
||||
RUN cd /etc/wireguard/ && echo "[Interface]" >> wg0.conf && echo -n "PrivateKey = " >> wg0.conf && cat privatekey >> wg0.conf \
|
||||
&& echo "ListenPort = 51820" >> wg0.conf && echo "Address = 10.1.1.1/32" >> wg0.conf && chmod 700 wg0.conf
|
||||
|
||||
|
||||
COPY requirements.txt /opt/wgdashboard/
|
||||
RUN pip3 install -r /opt/wgdashboard/requirements.txt --no-cache-dir
|
||||
|
||||
|
||||
FROM base
|
||||
COPY . /opt/WGDashboard/src
|
||||
WORKDIR /opt/WGDashboard/src
|
||||
|
||||
|
||||
EXPOSE 10086
|
||||
EXPOSE 51820/udp
|
||||
|
20
src/docker-compose.yaml
Normal file
20
src/docker-compose.yaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
version: "3.7"
|
||||
services:
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
container_name: WGDashboard
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
- SYS_MODULE
|
||||
command: python dashboard.py
|
||||
#command: gunicorn --bind 0.0.0.0:10086 dashboard:app
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./dashboard.py:/opt/WGDashboard/src/dashboard.py:rw
|
||||
ports:
|
||||
- 10086:10086
|
||||
- 51820:51820/udp
|
||||
sysctls:
|
||||
- net.ipv4.conf.all.src_valid_mark=1
|
Loading…
Reference in a new issue