docker-nginx-http3 icon indicating copy to clipboard operation
docker-nginx-http3 copied to clipboard

Can I set uid and gid for the internal user?

Open Scarecrow928 opened this issue 3 years ago • 2 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😭

Scarecrow928 avatar Dec 23 '22 08:12 Scarecrow928

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

Scarecrow928 avatar Jan 24 '23 02:01 Scarecrow928

I had the same need:

#123 Added uid and gid ARG for nginx user

victor-sm avatar Oct 18 '23 11:10 victor-sm