Skip to content

Commit ccec4b4

Browse files
authored
fix: use 1000 as the uid and gid of nginx user for consistency (#118)
- As a standard, use `1000` as the `uid` and `gid` of the user that runs the main process inside the container.
1 parent 257c74b commit ccec4b4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
FROM nginx:stable-alpine
44

5+
# With SDU/Hosting, we expect the containers to have `1000` as the user's ID and GID.
6+
# While we use the inbuilt `nginx` user to run the server, its id and gid are 101, so we change it here.
7+
RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories && \
8+
apk --no-cache add shadow && \
9+
groupmod -g 1000 nginx && \
10+
usermod -u 1000 -g 1000 nginx && \
11+
apk del shadow
12+
513
RUN rm /etc/nginx/conf.d/default.conf
614

715
# Copy Nginx configuration files

0 commit comments

Comments
 (0)