Skip to content

Commit 679e73b

Browse files
authored
fix: permissions of files to allow running as non-root (#10515)
1 parent 4bada92 commit 679e73b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ ENV API_KEY="**None**" \
2424
CORS="true" \
2525
EMBEDDING="false"
2626

27-
COPY --chown=nginx:nginx --chmod=0666 ./docker/default.conf.template ./docker/cors.conf ./docker/embedding.conf /etc/nginx/templates/
27+
COPY --chmod=0644 ./docker/default.conf.template ./docker/cors.conf ./docker/embedding.conf /etc/nginx/templates/
2828

29-
COPY --chmod=0666 ./dist/* /usr/share/nginx/html/
30-
COPY --chmod=0555 ./docker/docker-entrypoint.d/ /docker-entrypoint.d/
31-
COPY --chmod=0666 ./docker/configurator /usr/share/nginx/configurator
29+
COPY --chmod=0644 ./dist/* /usr/share/nginx/html/
30+
COPY --chmod=0755 ./docker/docker-entrypoint.d/ /docker-entrypoint.d/
31+
COPY --chmod=0644 ./docker/configurator /usr/share/nginx/configurator
3232

3333
# Simulates running NGINX as a non root; in future we want to use nginxinc/nginx-unprivileged.
3434
# In future we will have separate unpriviledged images tagged as v5.1.2-unprivileged.
35-
RUN chmod 777 /usr/share/nginx/html/ /etc/nginx/conf.d/ /etc/nginx/conf.d/default.conf /var/cache/nginx/ /var/run/
35+
RUN chmod 777 /etc/nginx/conf.d/ /usr/share/nginx/html/ /var/cache/nginx/ /var/run/ && \
36+
chmod 666 /etc/nginx/conf.d/default.conf /usr/share/nginx/html/swagger-initializer.js && \
37+
chmod 755 /etc/nginx/templates /usr/share/nginx/configurator
3638

3739
EXPOSE 8080

0 commit comments

Comments
 (0)