diff options
Diffstat (limited to 'opendc-web')
| -rw-r--r-- | opendc-web/opendc-web-ui/Dockerfile | 12 | ||||
| -rwxr-xr-x | opendc-web/opendc-web-ui/scripts/envsubst.sh | 4 |
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' {} \; |
