Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Hide nginx version from the dockerfile headers
Browse files Browse the repository at this point in the history
This is achieved by inserting the 'server_tokens off' setting into the nginx configuration file
  • Loading branch information
bartvanb committed Jan 12, 2024
1 parent d1cf36c commit 7fbfde9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ RUN npm run build --prod
FROM nginx:alpine
COPY --from=node /app/dist/vantage6-UI /usr/share/nginx/html


# add option to not share server info to nginx config file. Be sure to do this
# in the http block, which is achieved by matching that line
RUN sed -i '/http {/a \ \ \ \ server_tokens off;' /etc/nginx/nginx.conf

# When the container starts, replace the env.js with values from environment variables and then startup app
CMD ["/bin/sh", "-c", "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"]

0 comments on commit 7fbfde9

Please sign in to comment.