You must setup Podman and Lighttpd first.
Steps#
- create nvim directory in $HOME/podman
mkdir -p ~/podman/nvim && cd ~/podman/nvim
- copy from compose.yml
- copy from nvim.conf
nano ~/lighttpd/conf.d/nvim.conf
- create auth for nvim
printf "<username>:$(openssl passwd -6 <password>)" > ~/lighttpd/passwd/.nvim
- restart lighttpd
systemctl --user restart lighttpd
- 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" )
}