Setting up httpd with Portainer, storing htdocs in /share folder

I’m a Docker n00b, but here we go. I’ve got HassOS running fine, and I want to host a website on the same NUC machine. I’ve installed Portainer to try setting up httpd:alpine and actually got it working, but not the way I want. If i access 192.168.1.3:8088, i get to a site that says “It Works!”.

What I attempted to do, is to store the actual website files in the HassIO folder /share/htdocs so I can easily work with them using the VSCode addon, and have it included in the backup snapshots. This is the short version of my setup:

Volumes:
container: /htdocs (bind)
host: /mnt/data/supervisor/share/htdocs (Read-only)

By default, it was setup connected to the network in Bridge mode. I’ve tried joining the hassio network, as well as host (which was denied). I assume that my setup doesn’t actually access the HassIO shares folder, but creates a separate folder with a placeholder index.html file in it. How can I map this folder properly? Which network do I need to join (if any)?

Bonus question: Is there a label or similar i can add to the container to prevent it from being wiped if i run the ha su repair command from cli?

1 Like