diff --git a/README.md b/README.md index 91dd87f4..a9fc5b6b 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ network as well. Here's a quick command to run the server to try it out. -You can connect to the web server with http://localhost:8000 - If you open your browser using your LAN ip address you can even connect your -phone to try it out: for example, i'll open my browser at http://192.168.0.15:8000 -using my laptop's LAN IP address. +phone to try it out: for example, i'll open my browser at http://192.168.0.XX:8000 +using the local LAN IP address. -``` +You can connect to the web server on the local machine browser at http://localhost:8000 + +```bash docker run \ -it \ --rm \ @@ -50,11 +50,21 @@ docker run \ place1/wg-access-server ``` +## Running with Docker-Compose + +You modify the docker-compose.yml file for you need then run this following command. + +```bash +docker-compose up -d +``` + +You can connect to the web server on the local machine browser at http://localhost:8000 + ## Configuration You can configure the server using a yaml configuration file. Just mount the file into the container like this: -``` +```bash docker run \ ... \ -v $(pwd)/config.yaml:/config.yaml \ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..97de0332 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3.7" +services: + wg-access-server: + # to build the docker image from the source + # build: + # dockerfile: dockerfile + # context: . + image: place1/wg-access-server + container_name: wg-access-server + volumes: + - "wg-access-server-data:/data" + # - "config.yaml/config.yaml" # if you have a custom confg file + ports: + - "8000:8000/tcp" + - "51820:51820/udp" + devices: + - "/dev/net/tun:/dev/net/tun" + +# shared volumes with the host +volumes: + wg-access-server-data: + driver: local