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 diff --git a/Dockerfile b/Dockerfile index 8ce3219..08b96d2 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 @@ -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;"] 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