-
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.
chore: update frontend-usagers docker image to not depend on buildargs
- Loading branch information
Showing
4 changed files
with
48 additions
and
24 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
READONLY_DIR=/app | ||
WRITABLE_DIR=/usr/share/nginx/html | ||
|
||
cp -r $READONLY_DIR/* $WRITABLE_DIR/ | ||
|
||
cat <<EOF >>$WRITABLE_DIR/config.json | ||
{ | ||
"appVersion": "$ENV_NUXT_PUBLIC_APP_VERSION", | ||
"backendUrl": "$ENV_NUXT_PUBLIC_BACKEND_URL", | ||
"environment": "$ENV_NUXT_PUBLIC_ENVIRONMENT", | ||
"matomo": { | ||
"enabled": "$ENV_NUXT_PUBLIC_MATOMO_ENABLED", | ||
"host": "$ENV_NUXT_PUBLIC_MATOMO_HOST", | ||
"siteId": "$ENV_NUXT_PUBLIC_MATOMO_SITE_ID" | ||
}, | ||
"sentry": { | ||
"enabled": "$ENV_NUXT_PUBLIC_SENTRY_ENABLED", | ||
"dsn": "$ENV_NUXT_PUBLIC_SENTRY_DSN", | ||
"release": "$ENV_NUXT_PUBLIC_SENTRY_RELEASE" | ||
} | ||
} | ||
EOF |
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
13 changes: 13 additions & 0 deletions
13
packages/frontend-usagers/src/plugins/00.runtime-config.js
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,13 @@ | ||
import { defineNuxtPlugin } from "#app"; | ||
|
||
export default defineNuxtPlugin(async ({ $config }) => { | ||
if (import.meta.client) { | ||
try { | ||
const response = await fetch("/config.json"); | ||
const config = await response.json(); | ||
$config.public = { ...$config.public, ...config }; | ||
} catch (error) { | ||
console.error("Dynamic config unavailable (local)", error); | ||
} | ||
} | ||
}); |