-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use script to replace base addresses on startup
- Loading branch information
1 parent
ab3d032
commit 88cfa2a
Showing
3 changed files
with
26 additions
and
8 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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
FROM nginx:alpine | ||
FROM nginx:1.25-alpine | ||
WORKDIR /user/share/nginx/html | ||
EXPOSE 80 | ||
|
||
COPY output/wwwroot . | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
COPY prepare-appsettings.sh /docker-entrypoint.d/ | ||
RUN chmod +x /docker-entrypoint.d/prepare-appsettings.sh | ||
|
||
COPY output/wwwroot . |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
APPSETTINGS=/user/share/nginx/html/appsettings.json | ||
|
||
# delete compressed (brotli/gzip) appsettings files | ||
rm "$APPSETTINGS.br" | ||
rm "$APPSETTINGS.gz" | ||
|
||
# update base address value using environment variables | ||
sed -i -E "s|(\"AdminBaseAddress\"\:) \"(.*)\"(,)?|\1 \"$ADMIN_BASE_ADDRESS\"\3|g" $APPSETTINGS | ||
sed -i -E "s|(\"CashierBaseAddress\"\:) \"(.*)\"(,)?|\1 \"$CASHIER_BASE_ADDRESS\"\3|g" $APPSETTINGS | ||
sed -i -E "s|(\"BaristaBaseAddress\"\:) \"(.*)\"(,)?|\1 \"$BARISTA_BASE_ADDRESS\"\3|g" $APPSETTINGS | ||
|
||
cat $APPSETTINGS |