Docker-Compose cant find network mode vpn

33 Views Asked by At

I am trying to put my jellyfin conatiner behind a vpn with gluetun.

I have tried several solutions to no success.

my docker-compose looks like below.

version: '3'
services:
  vpn:
    ## Read https://github.com/qdm12/gluetun-wiki/tree/main/setup/providers for details on configuring VPN for your service provider.
    profiles: ["vpn"]
    image: qmcgaw/gluetun:v3.37.0
    cap_add:
      - NET_ADMIN
    environment:
      - VPN_SERVICE_PROVIDER=nordvpn # Valid values: nordvpn, expressvpn, protonvpn, surfshark or custom
      - OPENVPN_USER=
      - OPENVPN_PASSWORD=

      ## For list of server countries, visit https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json
      ## When VPN_SERVICE_PROVIDER is custom. Comment the below line
      - SERVER_COUNTRIES=Switzerland
    
      # - FREE_ONLY=on  # Valid with protonvpn only. Value willbe set "on" if using free subscription provided by protonvpn

      ## Enable below if VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=openvpn # or wireguard. 

      ## If VPN_TYPE is openvpn
      - OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf

    networks:
      - mynetwork
    
    # Uncomment/enable below ports if VPN is used/enabled
    ports:
    #   # qbittorrent ports
    #   - 5080:5080
    #   - 6881:6881
    #   - 6881:6881/udp
    #   # prowlarr ports
    #   - 9696:9696
      - 8123:8123
    restart: "unless-stopped"

  homeassistant:
    container_name: hass
    image: homeassistant/home-assistant
    network_mode: "service:vpn"
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    depends_on:
      - vpn

networks:
  mynetwork:
    external: true

Whenever I try to bring up the container i get an error stating network service:vpn cant be find. Can anyone shed any light to this issue looking at documentation that is the correct way to specify using the vpn service as the network mode.

Thanks

0

There are 0 best solutions below