File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,17 @@ RUN yarn install
1010COPY . /app
1111RUN yarn build
1212
13- FROM --platform=${BUILDPLATFORM} docker.io/nginx:alpine
13+ # Because we will be running as an unprivileged user, we need to make sure that the config file is writable
14+ # So, we will copy the default config to the /tmp folder that will be writable at runtime
15+ RUN mv -f target/config.json /config.json.bundled \
16+ && ln -sf /tmp/config.json target/config.json
17+
18+ FROM --platform=${BUILDPLATFORM} docker.io/nginxinc/nginx-unprivileged:alpine
1419
1520# Copy the dynamic config script
1621COPY ./docker/dynamic-config.sh /docker-entrypoint.d/99-dynamic-config.sh
22+ # And the bundled config file
23+ COPY --from=builder /config.json.bundled /config.json.bundled
1724
1825# Copy the built app from the first build stage
1926COPY --from=builder /app/target /usr/share/nginx/html
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ Then, start up a container from that image:
5555```
5656docker run \
5757 --name hydrogen \
58- --publish 80:80 \
58+ --publish 8080:8080 \
5959 hydrogen
6060```
6161
@@ -64,7 +64,7 @@ You can override the default `config.json` using the `CONFIG_OVERRIDE` environme
6464```
6565docker run \
6666 --name hydrogen \
67- --publish 80:80 \
67+ --publish 8080:8080 \
6868 --env CONFIG_OVERRIDE='{
6969 "push": {
7070 "appId": "io.element.hydrogen.web",
Original file line number Diff line number Diff line change 22
33set -eux
44
5- # Use config override environment variable if set
65if [ -n " ${CONFIG_OVERRIDE:- } " ]; then
7- echo " $CONFIG_OVERRIDE " > /usr/share/nginx/html/config.json
6+ # Use config override environment variable if set
7+ echo " $CONFIG_OVERRIDE " > /tmp/config.json
8+ else
9+ # Otherwise, use the default config that was bundled in the image
10+ cp /config.json.bundled /tmp/config.json
811fi
You can’t perform that action at this time.
0 commit comments