-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nginx): Use unpriviledged docker images (#956)
* chore(nginx): Use unpriviledged docker images * fix: Use 8080 instead of 80 as default port * fix: Fix variable * fix: Use raw UID values as ARG are not available from parent * chore: Remove envsubst * chore: Use same port as everywhere else * chore: Remove envsubst from nginx4spa * feat: USE 8080 port in nginx and nginx4spa images BREAKING CHANGE: port needs to be changed in projects using these images
- Loading branch information
Showing
30 changed files
with
23 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
FROM nginx:1.21-alpine | ||
FROM nginxinc/nginx-unprivileged:1.21-alpine | ||
|
||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
COPY ./entrypoint.sh /entrypoint.sh | ||
COPY ./envsub.sh /envsub.sh | ||
COPY ./404.html /usr/share/nginx/errors/ | ||
|
||
## adjust permissions | ||
USER root | ||
RUN chown -R nginx:nginx /usr/share/nginx/html && chmod -R 755 /usr/share/nginx/html && \ | ||
chown -R nginx:nginx /var/cache/nginx && \ | ||
chown -R nginx:nginx /var/log/nginx && \ | ||
chown -R nginx:nginx /etc/nginx | ||
|
||
RUN touch /var/run/nginx.pid && \ | ||
chown -R nginx:nginx /var/run/nginx.pid | ||
|
||
|
||
USER 101 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ services: | |
build: | ||
context: . | ||
ports: | ||
- target: 80 | ||
- target: 8080 | ||
published: 8888 | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
source /envsub.sh | ||
|
||
exec nginx -g 'daemon off;' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
FROM nginx:1.21-alpine | ||
FROM nginxinc/nginx-unprivileged:1.21-alpine | ||
|
||
COPY ./nginx.conf /etc/nginx/nginx.conf | ||
COPY ./entrypoint.sh /entrypoint.sh | ||
COPY ./envsub.sh /envsub.sh | ||
|
||
## adjust permissions | ||
USER root | ||
RUN chown -R nginx:nginx /usr/share/nginx/html && chmod -R 755 /usr/share/nginx/html && \ | ||
chown -R nginx:nginx /var/cache/nginx && \ | ||
chown -R nginx:nginx /var/log/nginx && \ | ||
chown -R nginx:nginx /etc/nginx | ||
|
||
RUN touch /var/run/nginx.pid && \ | ||
chown -R nginx:nginx /var/run/nginx.pid | ||
|
||
|
||
USER 101 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ services: | |
build: | ||
context: . | ||
ports: | ||
- target: 80 | ||
- target: 8080 | ||
published: 8888 | ||
|
||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#!/usr/bin/env sh | ||
|
||
source /envsub.sh | ||
|
||
exec nginx -g 'daemon off;' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.