Skip to content

Commit

Permalink
Merge pull request #2521 from kaitimmer/allow-readonly-root-filesytem
Browse files Browse the repository at this point in the history
Allow opencost-ui to run with a read-only root filesystem
  • Loading branch information
mattray committed Feb 12, 2024
2 parents 24ef3a6 + ffd6c44 commit 67bdd54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ ENV API_PORT=9003
ENV API_SERVER=0.0.0.0
ENV UI_PORT=9090

COPY --from=builder /opt/ui/dist /opt/ui/dist
RUN mkdir -p /var/www

COPY THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
COPY --from=builder /opt/ui/dist /var/www

COPY default.nginx.conf.template /etc/nginx/conf.d/default.nginx.conf.template
COPY nginx.conf /etc/nginx/
COPY ./docker-entrypoint.sh /usr/local/bin/
Expand Down
3 changes: 2 additions & 1 deletion ui/Dockerfile.cross
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ ENV API_PORT=9003
ENV API_SERVER=0.0.0.0
ENV UI_PORT=9090

COPY ./dist /opt/ui/dist
COPY THIRD_PARTY_LICENSES.txt /THIRD_PARTY_LICENSES.txt
COPY ./dist /var/www
COPY default.nginx.conf.template /etc/nginx/conf.d/default.nginx.conf.template
COPY nginx.conf /etc/nginx/
COPY ./docker-entrypoint.sh /usr/local/bin/
RUN mkdir -p /var/www

RUN rm -rf /etc/nginx/conf.d/default.conf

Expand Down
2 changes: 2 additions & 0 deletions ui/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
set -e

cp -rv /opt/ui/dist/* /var/www

if [[ ! -z "$BASE_URL_OVERRIDE" ]]; then
echo "running with BASE_URL=${BASE_URL_OVERRIDE}"
sed -i "s^{PLACEHOLDER_BASE_URL}^$BASE_URL_OVERRIDE^g" /var/www/*.js
Expand Down

0 comments on commit 67bdd54

Please sign in to comment.