mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-08 18:48:18 +01:00
Merge pull request #982 from vector-im/hughns/dynamic-config
Allow config override in docker image
This commit is contained in:
commit
365d017df3
@ -6,4 +6,9 @@ RUN yarn install \
|
|||||||
&& yarn build
|
&& yarn build
|
||||||
|
|
||||||
FROM docker.io/nginx:alpine
|
FROM docker.io/nginx:alpine
|
||||||
|
|
||||||
|
# Copy the dynamic config script
|
||||||
|
COPY ./docker/dynamic-config.sh /docker-entrypoint.d/99-dynamic-config.sh
|
||||||
|
|
||||||
|
# Copy the built app from the first build stage
|
||||||
COPY --from=builder /app/target /usr/share/nginx/html
|
COPY --from=builder /app/target /usr/share/nginx/html
|
||||||
|
@ -56,3 +56,27 @@ docker run \
|
|||||||
--publish 80:80 \
|
--publish 80:80 \
|
||||||
hydrogen
|
hydrogen
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can override the default `config.json` using the `CONFIG_OVERRIDE` environment variable. For example to specify a different Homeserver and :
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run \
|
||||||
|
--name hydrogen \
|
||||||
|
--publish 80:80 \
|
||||||
|
--env CONFIG_OVERRIDE='{
|
||||||
|
"push": {
|
||||||
|
"appId": "io.element.hydrogen.web",
|
||||||
|
"gatewayUrl": "https://matrix.org",
|
||||||
|
"applicationServerKey": "BC-gpSdVHEXhvHSHS0AzzWrQoukv2BE7KzpoPO_FfPacqOo3l1pdqz7rSgmB04pZCWaHPz7XRe6fjLaC-WPDopM"
|
||||||
|
},
|
||||||
|
"defaultHomeServer": "https://fosdem.org",
|
||||||
|
"themeManifests": [
|
||||||
|
"assets/theme-element.json"
|
||||||
|
],
|
||||||
|
"defaultTheme": {
|
||||||
|
"light": "element-light",
|
||||||
|
"dark": "element-dark"
|
||||||
|
}
|
||||||
|
}' \
|
||||||
|
hydrogen
|
||||||
|
```
|
||||||
|
8
docker/dynamic-config.sh
Executable file
8
docker/dynamic-config.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# Use config override environment variable if set
|
||||||
|
if [ -n "${CONFIG_OVERRIDE:-}" ]; then
|
||||||
|
echo "$CONFIG_OVERRIDE" > /usr/share/nginx/html/config.json
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user