-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use our base image to build UI's image (#24)
- Use our base nodejs/ngnix image to build to docker - Add section on running with SSL - Document SSL environment variables - Include certificate generation instructions - Add notes about SSL usage
- Loading branch information
Showing
6 changed files
with
123 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
FROM node:alpine | ||
FROM ghcr.io/littlehorse-enterprises/alpine-nginx-nodejs/nginx-nodejs:main | ||
WORKDIR /app | ||
|
||
COPY ./ui/.next/standalone ./ | ||
COPY ./ui/.next/static ./ui/.next/static | ||
COPY ./node_modules ./node_modules | ||
COPY ./ui/.next/standalone/ui ./ | ||
COPY ./ui/.next/standalone/node_modules ./node_modules | ||
COPY ./ui/.next/static ./.next/static | ||
|
||
COPY ./entrypoint.sh ./ | ||
|
||
ENV NODE_ENV=production \ | ||
PORT=3000 \ | ||
HOSTNAME="0.0.0.0" | ||
ENV PORT=3000 | ||
ENV HOSTNAME=0.0.0.0 | ||
ENV NODE_ENV=production | ||
|
||
EXPOSE 3000 | ||
|
||
ENTRYPOINT [ "./entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,8 @@ console.log(response); | |
scheduledTime: "2024-03-20T15:30:00Z", | ||
userGroup: { | ||
id: "550e8400-e29b-41d4-a716-446655440000", | ||
name: "Finance Team" | ||
name: "Finance Team", | ||
valid: true | ||
} | ||
}, | ||
{ | ||
|
@@ -58,14 +59,16 @@ console.log(response); | |
notes: "Document needs final approval", | ||
scheduledTime: "2024-03-20T14:00:00Z", | ||
userGroup: { | ||
id: "550e8400-e29b-41d4-a716-446655440002", | ||
name: "Legal Team" | ||
id: "legal", | ||
name: null, | ||
valid: false // This means the user group does not exist in the OIDC provider the api is configured with | ||
}, | ||
user: { | ||
id: "123e4567-e89b-12d3-a456-426614174002", | ||
email: "[email protected]", | ||
firstName: "John", | ||
lastName: "Doe" | ||
lastName: "Doe", | ||
valid: true | ||
} | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ if [ ! "${LHUT_API_URL+x}" ]; then | |
exit 1 | ||
fi | ||
|
||
node ui/server.js | ||
/entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if ! command -v openssl &> /dev/null; then | ||
echo "openssl command could not be found, install https://www.openssl.org/" | ||
exit 1 | ||
fi | ||
|
||
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd) | ||
cd "$SCRIPT_DIR" | ||
|
||
SSL_PATH=ssl | ||
rm -rf $SSL_PATH | ||
mkdir -p $SSL_PATH | ||
|
||
######################################################## | ||
# SSL Certificates | ||
######################################################## | ||
echo "Creating SSL Certificates" | ||
openssl req -x509 -sha256 -nodes \ | ||
-days 3650 -newkey rsa:2048 \ | ||
-subj '/O=LH User Tasks/CN=localhost' \ | ||
-keyout "$SSL_PATH/key.pem" \ | ||
-out "$SSL_PATH/cert.pem" \ | ||
-addext "subjectAltName = DNS:localhost" > /dev/null 2>&1 | ||
|
||
echo "Certificates generated successfully in $SSL_PATH/" | ||
echo "- cert.pem: SSL certificate" | ||
echo "- key.pem: Private key" |