macbre / docker-nginx-http3

Stable and up-to-date root-less nginx with quic + http/3, google brotli compression, njs, GeoIP2, and Grade A+ SSL config

Home Page:https://hub.docker.com/r/macbre/nginx-http3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I set uid and gid for the internal user?

Scarecrow928 opened this issue · comments

It seems that nginx will not run as root, so can I set uid and gid for the internal user? for example like linuxserver passing env variables PGID and PUID? Really need this😭

ok I can simply do this with the docker run flag --user:

docker run --user=1000:1000 macbre/nginx-http3 ash

or the compose argument user:

version: "3"
services:
  nginx:
    image: macbre/nginx-http3
    user: root
    container_name: nginx
    ports:
      - 80:80
      - 443:443
      - 443:443/udp
    volumes:
      - ./nginx/https.conf:/etc/nginx/conf.d/https.conf
      - ./log:/var/log/nginx
      - ./www:/var/www
    restart: unless-stopped

Letting the users decide the UID and GID may be a better choice