From 44f455a2a21f16be5e57980b4f17577297b7bbab Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 6 Nov 2024 12:13:10 +0100 Subject: [PATCH 1/3] feat: updated to use latest official nginx image --- Dockerfile | 8 ++++---- README.md | 2 +- default.conf | 6 +++--- locations/base.conf | 2 +- locations/common.conf | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ce3219..d2f176b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM bitnami/nginx:1.25.4 +FROM nginx:1.27.2 -ENV DIR_NGINX /opt/bitnami/nginx -ENV DIR_SERVER_BLOCKS ${DIR_NGINX}/conf/server_blocks +ENV DIR_NGINX /etc/nginx +ENV DIR_SERVER_BLOCKS ${DIR_NGINX}/conf.d ENV DIR_LOCATION ${DIR_SERVER_BLOCKS}/locations -ENV DIR_HTML ${DIR_NGINX}/html +ENV DIR_HTML /usr/share/nginx/html ENV DIR_ASSETS ${DIR_HTML}/assets ENV CORS_ENABLED false diff --git a/README.md b/README.md index 30af68e..ccacd55 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Base image for single page apps -This image is basedon in NginX(Bitnami variant). +This image is basedon in NginX. It exposes NginX http server on port 8080, provides a simple static endpoint for healthcheck at `/healthcheck` url. All images and fonts will have cache headers set to 1 month, as well as webpack hashed assets(js and css bundles) as they have hashes included in their names. # Usage diff --git a/default.conf b/default.conf index 420fa86..8bb013e 100644 --- a/default.conf +++ b/default.conf @@ -3,8 +3,8 @@ server { listen 8080; server_name localhost; port_in_redirect off; - root /opt/bitnami/nginx/html; - index index.html index.htm; + root /usr/share/nginx/html; + index index.html index.html; error_page 404 /custom_404.html; error_page 500 /custom_500.html; gzip on; @@ -33,5 +33,5 @@ server { add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT"; add_header Pragma no-cache; - include "/opt/bitnami/nginx/conf/server_blocks/locations/*.conf"; + include "/etc/nginx/conf.d/locations/*.conf"; } diff --git a/locations/base.conf b/locations/base.conf index 3a8d45e..6f641ac 100644 --- a/locations/base.conf +++ b/locations/base.conf @@ -1,6 +1,6 @@ location @@APP_BASE_HREF { # try_files $uri $uri/$is_args$args =404; - alias /opt/bitnami/nginx/html/; + alias /usr/share/nginx/html/; try_files $uri $uri/ /index.html /index.html; sub_filter_once off; diff --git a/locations/common.conf b/locations/common.conf index a42645f..6a67378 100644 --- a/locations/common.conf +++ b/locations/common.conf @@ -5,16 +5,16 @@ } location = /custom_404.html { - root /opt/bitnami/nginx/html/static; + root /usr/share/nginx/html/static; internal; } location = /custom_500.html { - root /opt/bitnami/nginx/html/static; + root /usr/share/nginx/html/static; internal; } location = /error/ { - alias /opt/bitnami/nginx/html/static/; + alias /usr/share/nginx/html/static/; try_files $uri $uri/ = 404; } \ No newline at end of file From ed46b3db1803b0283a122928e736d076cb1e4f4d Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 6 Nov 2024 13:48:47 +0100 Subject: [PATCH 2/3] feat: added commands --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d2f176b..08b96d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,7 @@ COPY default.conf ${DIR_SERVER_BLOCKS} # default list of environment variable names ENV CONFIG_ENV_LIST BFF_URL,APP_BASE_HREF,CORS_ENABLED,APP_VERSION,APP_ID,PRODUCT_NAME,TKIT_PORTAL_URL +RUN chown -R 1001:1001 /var && mkdir -p /var/run && touch /var/run/nginx.pid && chmod 775 -R /var/run/nginx.pid ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] CMD ["nginx", "-g", "daemon off;"] From 1b5c49724c2e7e4891959f483617ab01e8d6b47c Mon Sep 17 00:00:00 2001 From: Jorden_Reuter Date: Wed, 6 Nov 2024 16:21:32 +0100 Subject: [PATCH 3/3] feat: added dependeabot.yml --- .github/depenabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/depenabot.yml diff --git a/.github/depenabot.yml b/.github/depenabot.yml new file mode 100644 index 0000000..a431d8a --- /dev/null +++ b/.github/depenabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: daily + labels: + - docker-image \ No newline at end of file