11# syntax=docker/dockerfile-upstream:master-experimental
2+ FROM node:16.19.1-bullseye-slim as builder
3+
4+ WORKDIR /cube
5+ COPY . .
6+
7+ RUN yarn policies set-version v1.22.5
8+
9+ # Required for node-oracledb to buld on ARM64
10+ RUN apt-get update \
11+ && apt-get install -y python3 gcc g++ make cmake openjdk-11-jdk-headless \
12+ && rm -rf /var/lib/apt/lists/*
13+
14+ # We are copying root yarn.lock file to the context folder during the Publish GH
15+ # action. So, a process will use the root lock file here.
16+ RUN yarn install && yarn cache clean
17+
218FROM node:16.19.1-bullseye-slim
319
420ARG IMAGE_VERSION=unknown
521
622ENV CUBEJS_DOCKER_IMAGE_VERSION=$IMAGE_VERSION
723ENV CUBEJS_DOCKER_IMAGE_TAG=latest
824
9- RUN DEBIAN_FRONTEND=noninteractive \
25+ RUN groupadd cube && useradd -ms /bin/bash -g cube cube \
26+ && DEBIAN_FRONTEND=noninteractive \
1027 && apt-get update \
11- && apt-get install -y --no-install-recommends rxvt-unicode libssl1.1 \
12- && rm -rf /var/lib/apt/lists/*
13-
14- ENV TERM rxvt-unicode
15- ENV NODE_ENV production
16-
17- # Required for node-oracledb to buld on ARM64
18- RUN groupadd cube \
19- && useradd -ms /bin/bash -g cube cube \
20- && apt-get clean \
21- && apt-get update \
22- && apt-get install -y python2 python3 gcc g++ make cmake openjdk-11-jdk-headless \
23- && npm config set python /usr/bin/python2.7 \
28+ && apt-get install -y --no-install-recommends rxvt-unicode libssl1.1 openjdk-11-jdk-headless \
2429 && rm -rf /var/lib/apt/lists/* \
2530 && mkdir cube \
2631 && chown -R cube:cube /tmp /cube /usr
2732
2833USER cube
2934WORKDIR /cube
30- COPY --chown=cube:cube . .
3135
32- # We are copying root yarn.lock file to the context folder during the Publish GH
33- # action. So, a process will use the root lock file here.
34- RUN yarn policies set-version v1.22.5 \
35- && yarn install && yarn cache clean
36+ RUN yarn policies set-version v1.22.5
37+
38+ ENV TERM rxvt-unicode
39+ ENV NODE_ENV production
40+
41+ COPY --chown=cube:cube --from=builder /cube .
3642
3743# By default Node dont search in parent directory from /cube/conf, @todo Reaserch a little bit more
3844ENV NODE_PATH /cube/conf/node_modules:/cube/node_modules
39- RUN ln -s /cube/node_modules/.bin/cubejs /usr/local/bin/cubejs \
40- && ln -s /cube/node_modules/.bin/cubestore-dev /usr/local/bin/cubestore-dev
45+ RUN ln -s /cube/node_modules/.bin/cubejs /usr/local/bin/cubejs
46+ RUN ln -s /cube/node_modules/.bin/cubestore-dev /usr/local/bin/cubestore-dev
4147
4248WORKDIR /cube/conf
4349
4450EXPOSE 4000
4551
46- CMD ["cubejs" , "server" ]
52+ CMD ["cubejs" , "server" ]
0 commit comments