Skip to content

Commit

Permalink
Add healthcheck to Wireguard
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon committed Oct 30, 2023
1 parent a7528da commit 74773ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
run: |
ssh root@${{ secrets.IP }} "mkdir -p /root/freeflix"
rsync -vrm ./dist/* root@${{ secrets.IP }}:/root/freeflix/dist --delete
ssh root@${{ secrets.IP }} "docker pull nxie/wireguard"
ssh root@${{ secrets.IP }} "cd /root/freeflix && docker-compose --profile serve down; exit 0"
scp ./docker-compose.yml root@${{ secrets.IP }}:/root/freeflix/docker-compose.yml
scp ./.env root@${{ secrets.IP }}:/root/freeflix/.env
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ services:
volumes:
- ./:/app
client:
depends_on:
- wireguard
wireguard:
condition: service_healthy
profiles: [serve]
image: alpine:latest
logging:
Expand All @@ -106,6 +106,11 @@ services:
env_file: .env
image: nxie/wireguard:latest
container_name: wireguard
healthcheck:
test: bash -c "[ -f /tmp/wireguard.lock ]"
interval: 1s
timeout: 3s
retries: 10
cap_add:
- NET_ADMIN
networks:
Expand Down

0 comments on commit 74773ff

Please sign in to comment.