-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from wmo-im/docker-update
add healthcheck and new vite env variables
- Loading branch information
Showing
5 changed files
with
49 additions
and
7 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
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,9 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Set VITE_API_URL to the value of WIS2BOX_API_URL | ||
echo "set VITE_API_URL to the value of WIS2BOX_API_URL in .env" | ||
echo "VITE_API_URL=$WIS2BOX_API_URL" | ||
export VITE_API_URL=$WIS2BOX_API_URL | ||
# check WIS2BOX_URL is set | ||
if [ -z "$WIS2BOX_URL" ]; then | ||
echo "WIS2BOX_URL is not set" | ||
exit 1 | ||
fi | ||
|
||
# Set VITE_URL to the value of WIS2BOX_URL/oapi | ||
echo "VITE_API_URL=$WIS2BOX_URL/oapi" | ||
export VITE_API_URL=$WIS2BOX_URL/oapi | ||
|
||
# Set VITE_BASE_URL to the value of WIS2BOX_URL/wis2box-webapp | ||
echo "VITE_BASE_URL=$WIS2BOX_URL/wis2box-webapp" | ||
export VITE_BASE_URL=$WIS2BOX_URL/wis2box-webapp | ||
|
||
# Set VITE_BASEMAP_URL to WIS2BOX_BASEMAP_URL if it is set | ||
if [ -z "$WIS2BOX_BASEMAP_URL" ]; then | ||
echo "WIS2BOX_BASEMAP_URL is not set use default basemap" | ||
VITE_BASEMAP_URL="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
else | ||
export VITE_BASEMAP_URL=$WIS2BOX_BASEMAP_URL | ||
fi | ||
echo "VITE_BASEMAP_URL=$VITE_BASEMAP_URL" | ||
|
||
# repeat for VITE_BASEMAP_ATTRIBUTION | ||
if [ -z "$WIS2BOX_BASEMAP_ATTRIBUTION" ]; then | ||
echo "WIS2BOX_BASEMAP_ATTRIBUTION is not set use default basemap attribution" | ||
VITE_BASEMAP_ATTRIBUTION="<a href="https://osm.org/copyright">OpenStreetMap</a> contributors" | ||
else | ||
export VITE_BASEMAP_ATTRIBUTION=$WIS2BOX_BASEMAP_ATTRIBUTION | ||
fi | ||
echo "VITE_BASEMAP_ATTRIBUTION=$VITE_BASEMAP_ATTRIBUTION" | ||
|
||
npm run build | ||
npm run preview |
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,9 @@ | ||
#!/bin/sh | ||
# Custom health check script | ||
|
||
# Check if npm run preview is running | ||
if ps aux | grep 'npm run preview' | grep -v grep; then | ||
exit 0 # Process found, container is healthy | ||
else | ||
exit 1 # Process not found, container is not healthy | ||
fi |