From d7a3910779d86def9587d6be7548c36dcf0a1845 Mon Sep 17 00:00:00 2001 From: redxef Date: Wed, 17 Jan 2024 22:04:46 +0100 Subject: [PATCH] Improve Dockerfile. --- dev/Dockerfile | 5 ----- dev/docker-compose.yaml.tmpl | 6 +++++- dev/server/Dockerfile | 5 +++++ dev/server/entrypoint.sh | 5 +++++ 4 files changed, 15 insertions(+), 6 deletions(-) delete mode 100644 dev/Dockerfile create mode 100644 dev/server/Dockerfile create mode 100755 dev/server/entrypoint.sh diff --git a/dev/Dockerfile b/dev/Dockerfile deleted file mode 100644 index 740da2b..0000000 --- a/dev/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM alpine - -RUN apk add --no-cache wireguard-tools-wg-quick - - diff --git a/dev/docker-compose.yaml.tmpl b/dev/docker-compose.yaml.tmpl index 59f8d39..4804948 100644 --- a/dev/docker-compose.yaml.tmpl +++ b/dev/docker-compose.yaml.tmpl @@ -5,11 +5,15 @@ services: {% for item in keypairs %} {{ item.item }}: build: - dockerfile: Dockerfile + context: ./server/ volumes: - ./config/{{ item.item }}-wg0.conf:/etc/wireguard/wg0.conf networks: - default + expose: + - 51871 + command: [ "sleep", "10000" ] + cap_add: [ "NET_ADMIN" ] {% endfor %} networks: default: diff --git a/dev/server/Dockerfile b/dev/server/Dockerfile new file mode 100644 index 0000000..ee2b37d --- /dev/null +++ b/dev/server/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine + +RUN apk add --no-cache wireguard-tools-wg-quick +COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] diff --git a/dev/server/entrypoint.sh b/dev/server/entrypoint.sh new file mode 100755 index 0000000..4610648 --- /dev/null +++ b/dev/server/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +wg-quick up wg0 + +"$@"