Improve Dockerfile.

This commit is contained in:
redxef 2024-01-17 22:04:46 +01:00
parent e4d34fbabb
commit d7a3910779
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
4 changed files with 15 additions and 6 deletions

View file

@ -1,5 +0,0 @@
FROM alpine
RUN apk add --no-cache wireguard-tools-wg-quick

View file

@ -5,11 +5,15 @@ services:
{% for item in keypairs %} {% for item in keypairs %}
{{ item.item }}: {{ item.item }}:
build: build:
dockerfile: Dockerfile context: ./server/
volumes: volumes:
- ./config/{{ item.item }}-wg0.conf:/etc/wireguard/wg0.conf - ./config/{{ item.item }}-wg0.conf:/etc/wireguard/wg0.conf
networks: networks:
- default - default
expose:
- 51871
command: [ "sleep", "10000" ]
cap_add: [ "NET_ADMIN" ]
{% endfor %} {% endfor %}
networks: networks:
default: default:

5
dev/server/Dockerfile Normal file
View file

@ -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" ]

5
dev/server/entrypoint.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
wg-quick up wg0
"$@"