-
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.
- Loading branch information
1 parent
010378b
commit 314a7b9
Showing
5 changed files
with
66 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:lts AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
# Production stage | ||
FROM nginx:stable-bookworm | ||
|
||
# Install envsubst | ||
RUN apt-get update && apt-get install -y gettext-base && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
COPY docker-entrypoint.sh /docker-entrypoint.sh | ||
RUN chmod +x /docker-entrypoint.sh | ||
|
||
EXPOSE 80 | ||
|
||
ENTRYPOINT ["/docker-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,18 @@ | ||
#!/bin/env bash | ||
|
||
# List of environment variables to include | ||
include_vars=("ALERT_MANAGEMENT_BASE_URL" "PATIENT_MANAGEMENT_BASE_URL") | ||
|
||
# Convert specified environment variables to JSON format | ||
{ | ||
echo "{" | ||
for var in "${include_vars[@]}"; do | ||
if [ -n "${!var}" ]; then | ||
echo "\"$var\":\"${!var}\"," | ||
fi | ||
done | ||
echo "}" | sed 's/,}/}/' | ||
} > /usr/share/nginx/html/env | ||
|
||
# Start Nginx | ||
nginx -g "daemon off;" |
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
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