Skip to content

Commit

Permalink
migrate VPN service to Docker Compos
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhadapaithankar committed Oct 3, 2024
1 parent f83191f commit a6ded87
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile.vpn
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Use a Microsoft-approved image
FROM mcr.microsoft.com/azure-cli:2.61.0 AS base

# Install OpenVPN
USER root
RUN apk add --no-cache openvpn || tdnf install -y openvpn || dnf install -y openvpn

ENTRYPOINT openvpn
2 changes: 2 additions & 0 deletions Dockerfile.vpn.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ignore everything
*
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,13 @@ run-rp: ci-rp podman-secrets
--secret proxy-client.crt,target=/app/secrets/proxy-client.crt \
--secret proxy.crt,target=/app/secrets/proxy.crt \
$(LOCAL_ARO_RP_IMAGE):$(VERSION) rp

.PHONY: vpn
vpn:
docker compose build vpn

.PHONY: run-vpn
run-vpn:
docker compose rm -sf vpn
docker compose up vpn
docker compose logs --follow vpn
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
vpn:
image: vpn:${VERSION}
build:
context: .
dockerfile: Dockerfile.vpn
container_name: vpn
privileged: true
volumes:
- ${PWD}/secrets:/secrets:z
entrypoint: "openvpn"
command: ["/secrets/vpn-eastus.ovpn"]
healthcheck:
test: ["CMD", "pidof", "openvpn"]
start_period: 20s
interval: 20s
timeout: 3s
retries: 3

0 comments on commit a6ded87

Please sign in to comment.