mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Allow config override in docker image
This commit is contained in:
parent
a565d2a7d3
commit
df6474b637
@ -6,4 +6,9 @@ RUN yarn install \
|
||||
&& yarn build
|
||||
|
||||
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
|
||||
|
@ -56,3 +56,27 @@ docker run \
|
||||
--publish 80:80 \
|
||||
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…
Reference in New Issue
Block a user