Skip to content

Commit

Permalink
Merge pull request #2 from JordenReuter/feature/use-official-nginx
Browse files Browse the repository at this point in the history
feat: updated to use latest official nginx image
  • Loading branch information
andrejpetras authored Nov 21, 2024
2 parents c7a56aa + 1b5c497 commit ceb7882
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .github/depenabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: daily
labels:
- docker-image
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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";
}
2 changes: 1 addition & 1 deletion locations/base.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
6 changes: 3 additions & 3 deletions locations/common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit ceb7882

Please sign in to comment.