services: mullvad: build: { context: ., dockerfile: Dockerfile.mullvad } container_name: mullvad-vpn cap_add: [NET_ADMIN] devices: [/dev/net/tun:/dev/net/tun] restart: unless-stopped # Example: route any container through the VPN app1: image: rockylinux/rockylinux:10 network_mode: "container:mullvad-vpn" depends_on: [mullvad] command: bash -c "dnf install -y curl && curl -s https://am.i.mullvad.net/connected && curl -s https://am.i.mullvad.net/ip && curl -s https://am.i.mullvad.net/country && curl -s https://am.i.mullvad.net/city"