Skip to content

Commit 2535877

Browse files
committed
simplified build-npm container
1 parent 4eee6e5 commit 2535877

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

Dockerfile-build-npm

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1-
ARG IMAGE=intersystemsdc/iris-community
2-
FROM $IMAGE
3-
4-
USER root
1+
FROM ubuntu:latest
2+
ARG NODE_VERSION=10
53

64
# install curl
75
RUN apt update && apt install curl -y
86

9-
# set env
10-
ENV NVM_DIR=/root/.nvm
11-
127
# install nvm
138
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
149

10+
# set env
11+
ENV NVM_DIR=/root/.nvm
12+
1513
# install node
16-
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install 10 && nvm use 10"
14+
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install ${NODE_VERSION} && nvm use ${NODE_VERSION}"
1715

1816
# copy code
1917
WORKDIR /opt/irisapp
2018
COPY src ./src
2119
COPY gulpfile.js .
2220
COPY package.json .
23-
COPY iris-build-npm.script .
2421

2522
# build npm
2623
RUN bash -c "source $NVM_DIR/nvm.sh && npm install && npm run gulp"
2724

28-
#RUN mkdir /opt/irisapp/export/
29-
#RUN chown -R ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
30-
USER ${ISC_PACKAGE_MGRUSER}
3125

32-
# import/export IRIS
33-
#RUN iris start iris && \
34-
# iris session iris < iris-build-npm.script && \
35-
# iris stop iris quietly
26+
# set ENTRYPOINT for reloading nvm-environment
27+
ENTRYPOINT ["bash", "-c", "source $NVM_DIR/nvm.sh && exec \"$@\"", "--"]
28+
29+
# set cmd to bash
30+
CMD ["/bin/bash"]

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ This will bring `ClassExplorer-v*.*.*.xml` to the `build` directory, which you c
6565

6666
### Using docker
6767

68-
:warning: incomplete procedure
68+
:warning: The following is a rather naive way of building the web app for ZPM packaging using an [nvm docker script](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-in-docker), starting the image as a daemon, and then manually copying the files back out.
6969

7070
```Shell
7171
docker build -f ./Dockerfile-build-npm -t build-npm .
72-
docker run --rm -d --name build-npm build-npm
72+
docker run --rm -d --name build-npm build-npm /bin/bash -c 'while true; do sleep 30; done'
7373
docker cp build-npm:/opt/irisapp/build/cls/ClassExplorer.ClassView.cls ./build-for-zpm/ClassExplorer/ClassView.cls
7474
docker cp build-npm:/opt/irisapp/build/cls/ClassExplorer.Router.cls ./build-for-zpm/ClassExplorer/Router.cls
7575
docker cp build-npm:/opt/irisapp/build/cls/ClassExplorer.StaticContent.cls ./build-for-zpm/ClassExplorer/StaticContent.cls

0 commit comments

Comments
 (0)