Emrah AKIN
Emrah AKIN

Reputation: 173

Automatically connect Docker Container to PPTP VPN

I want my Docker Containers running in the Docker Compose file to automatically connect to the PPTP VPN on a remote server when they start running.

PPTP VPN on the remote server is on a Windows Server. OpenVPN is not installed on it. I made a Docker Compose file as I sent in the sample file, but the Container still does not connect to the VPN.

version: '3.4'

services:

  vpn:
    image: mobtitude/vpn-pptp
    environment:
       - PPTP_USERNAME="user name"
       - PPTP_PASSWORD= "şifre"
       - PPTP_SERVER_IP= "IP adress"
    privileged: true
    cap_add:
       - ALL
    sysctls:
      - net.ipv4.ip_forward=1
    networks:
       - net_backendservices

  container1:
    container_name: container1
    image: ${DOCKER_REGISTRY-}container1
    build:
      context: .
      dockerfile: src/Container1/Dockerfile
    networks:
      - net_backendservices
    security_opt:
      - "apparmor:unconfined"

networks:
  net_backendservices:
    driver: bridge
    ipam:
      config:
        - subnet: 172.29.0.0/16

Upvotes: 1

Views: 443

Answers (0)

Related Questions