You must setup Podman and Lighttpd first.

Steps

  1. create nvim directory in $HOME/podman
    mkdir -p ~/podman/nvim && cd ~/podman/nvim
    
  2. copy from compose.yml
    nano compose.yml
    
  3. copy from nvim.conf
    nano ~/lighttpd/conf.d/nvim.conf
    
  4. create auth for nvim
    printf "<username>:$(openssl passwd -6 <password>)" > ~/lighttpd/passwd/.nvim
    
  5. restart lighttpd
    systemctl --user restart lighttpd
    
  6. start nvim
    podman-compose -f ~/podman/nvim/compose.yml systemd -a register
    systemctl --user enable --now podman-compose@nvim
    

compose.yml

version: "3"
services:
  nvim:
    image: docker.io/heinokesoe/nvim:latest
    container_name: nvim
    ports:
      - 127.0.0.1:1343:3000
    volumes:
      - ./local:/root/.local
      - ./workspace:/root/workspace
    environment:
      - REVERSE_PROXY=true
    hostname: nvim
    restart: unless-stopped
    labels:
      - "io.containers.autoupdate=registry"

nvim.conf

$HTTP["host"] == "nvim.example.com" {
    auth.backend = "htpasswd"
    auth.backend.htpasswd.userfile= env.HOME + "/lighttpd/passwd/.nvim"
    auth.require = ( "" =>
    (
    "method"  => "basic",
    "realm"   => "Restricted!",
    "require" => "valid-user"
    ),
)
    proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "1343" ) ) )
    proxy.header = ( "upgrade" => "enable" )
}