Skip to content

Commit

Permalink
Replace python script with node script for portal Dockerfile (#18635)
Browse files Browse the repository at this point in the history
Signed-off-by: AllForNothing <[email protected]>
  • Loading branch information
AllForNothing authored May 4, 2023
1 parent 362387f commit 0a3509f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions make/photon/portal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ WORKDIR /build_dir

ARG npm_registry=https://registry.npmjs.org

RUN apt-get update \
&& apt-get install -y --no-install-recommends python-yaml

COPY ./api/v2.0/swagger.yaml /build_dir/swagger.yaml
COPY src/portal /build_dir

ENV NPM_CONFIG_REGISTRY=${npm_registry}
RUN npm install --unsafe-perm
RUN npm run generate-build-timestamp
RUN node --max_old_space_size=2048 'node_modules/@angular/cli/bin/ng' build --configuration production
RUN python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' < swagger.yaml > dist/swagger.json
RUN npm install [email protected] \
&& node -e "const yaml = require('js-yaml'); const fs = require('fs'); const swagger = yaml.load(fs.readFileSync('swagger.yaml', 'utf8')); fs.writeFileSync('swagger.json', JSON.stringify(swagger));"

COPY ./LICENSE /build_dir/dist

Expand Down

0 comments on commit 0a3509f

Please sign in to comment.