summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-07-30 12:20:42 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:55:11 +0200
commitec39ad82a9257c3aae11ef60c0c81a1362b73ead (patch)
tree07c733bd51e811564bf817ef788f3859ed19f8a3 /opendc-web/opendc-web-ui
parentacfab9d4ca84e9331bb40c74d300c593915c542a (diff)
fix(web/ui): Fix Docker deployment
This change fixes the Docker deployment of the OpenDC web UI. There have been several updates to the build process of the web UI, which have not taken into account the Docker deployment process. This change addresses these discrepancies.
Diffstat (limited to 'opendc-web/opendc-web-ui')
-rw-r--r--opendc-web/opendc-web-ui/Dockerfile12
-rwxr-xr-xopendc-web/opendc-web-ui/scripts/envsubst.sh4
2 files changed, 8 insertions, 8 deletions
diff --git a/opendc-web/opendc-web-ui/Dockerfile b/opendc-web/opendc-web-ui/Dockerfile
index 15a92068..5ff85092 100644
--- a/opendc-web/opendc-web-ui/Dockerfile
+++ b/opendc-web/opendc-web-ui/Dockerfile
@@ -2,8 +2,8 @@ FROM node:16 AS staging
MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
# Copy package details
-COPY ./package.json ./yarn.lock /opendc/
-RUN cd /opendc && yarn install --frozen-lockfile
+COPY ./package.json ./package-lock.json /opendc/
+RUN cd /opendc && npm ci
# Build frontend
FROM node:16 AS build
@@ -17,12 +17,12 @@ RUN cd /opendc/ \
NEXT_PUBLIC_AUTH0_DOMAIN="%%NEXT_PUBLIC_AUTH0_DOMAIN%%" \
NEXT_PUBLIC_AUTH0_CLIENT_ID="%%NEXT_PUBLIC_AUTH0_CLIENT_ID%%" \
NEXT_PUBLIC_AUTH0_AUDIENCE="%%NEXT_PUBLIC_AUTH0_AUDIENCE%%" \
- && yarn build \
- && yarn cache clean --all \
- && mv .next .next.template
+ && npm run build \
+ && npm cache clean --force \
+ && mv build/next build/next.template
FROM node:16-slim
COPY --from=build /opendc /opendc
WORKDIR /opendc
-CMD ./scripts/envsubst.sh; yarn start
+CMD ./scripts/envsubst.sh; npm run start
diff --git a/opendc-web/opendc-web-ui/scripts/envsubst.sh b/opendc-web/opendc-web-ui/scripts/envsubst.sh
index d7ae9ecb..afc976ed 100755
--- a/opendc-web/opendc-web-ui/scripts/envsubst.sh
+++ b/opendc-web/opendc-web-ui/scripts/envsubst.sh
@@ -3,8 +3,8 @@
set -e
auto_envsubst() {
- input_path="/opendc/.next.template"
- output_path="/opendc/.next"
+ input_path="build/next.template"
+ output_path="build/next"
cp -r "$input_path" "$output_path"
find "$output_path" -type f -name '*.js' -exec perl -pi -e 's/%%(NEXT_PUBLIC_[_A-Z0-9]+)%%/$ENV{$1}/g' {} \;