Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes to add ssl support #935

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions ssl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# build stage
FROM neo4jlabs/neodash:latest AS neodash

ENV NGINX_HTTPS_PORT=5443

USER root

RUN mkdir -p /etc/nginx/certs

RUN --mount=type=secret,id=NEODASH_SSL_KEY \
base64 -d /run/secrets/NEODASH_SSL_KEY > /etc/nginx/certs/key.pem

RUN --mount=type=secret,id=NEODASH_SSL_CERT \
base64 -d /run/secrets/NEODASH_SSL_CERT > /etc/nginx/certs/cert.pem

COPY default.conf /etc/nginx/templates/default.conf.template
COPY default.conf /etc/nginx/conf.d/

RUN chown -R nginx:nginx /etc/nginx

USER nginx
EXPOSE $NGINX_HTTPS_PORT

HEALTHCHECK CMD curl --fail "https://localhost:$NGINX_HTTPS_PORT" || exit 1
LABEL version="1.0"
34 changes: 34 additions & 0 deletions ssl/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
server {
listen ${NGINX_PORT};
server_name localhost;
include mime.types;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
# Note: This is optional, depending on the implementation in React
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
server {
listen 5443 ssl;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
server_name localhost;
include mime.types;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
# Note: This is optional, depending on the implementation in React
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}