You will serve a host directory through nginx — in another image, where requests are handled by a user other than root.
Every morning a fresh report appears in ~/report, and it has to be served over HTTP through nginx from the nginx:alpine image. There is no point in rebuilding the image for each report — let the container see the host directory. nginx in this image serves files from /usr/share/nginx/html and listens on port 80. The main nginx process runs as root, while requests are handled by worker processes running as the nginx user, UID 101.
Serve the report through nginx
Run a report container from the nginx:alpine image with the ~/report directory in place of /usr/share/nginx/html so that the report opens on port 8081. You stay the owner of index.html, and the owner alone may write to it.
Goals · 0 of 2
- Run report with the ~/report directory not done yet
- Serve the report on port 8081 not done yet