-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.buildtest.cjs
24 lines (22 loc) · 1.37 KB
/
Dockerfile.buildtest.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM node:16-alpine@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b AS packer
WORKDIR /usr/src/boardgamegeekclient-packfase
COPY . .
RUN yarn pack
FROM node:16-alpine@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b AS compiler
WORKDIR /usr/src/boardgamegeekclient-compilerfase
COPY --from=packer /usr/src/boardgamegeekclient-packfase/test/unit/utils utils
COPY --from=packer /usr/src/boardgamegeekclient-packfase/buildtest/cjs/ .
RUN yarn add global typescript && yarn add -D @types/node && npx tsc -p tsconfig.cjs.json && mv utils/reflection/reflectionexport.json dist-utils/reflection/reflectionexport.json
FROM node:16-alpine@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b AS commmonjstester
ARG VERSION
RUN echo "received: ${VERSION}"
WORKDIR /usr/src/boardgamegeekclient-test
COPY --from=packer /usr/src/boardgamegeekclient-packfase/boardgamegeekclient-v${VERSION}.tgz .
COPY --from=compiler /usr/src/boardgamegeekclient-compilerfase/dist-utils dist-utils
COPY --from=compiler /usr/src/boardgamegeekclient-compilerfase/index.test.js .
COPY --from=packer /usr/src/boardgamegeekclient-packfase/buildtest/cjs/package.json .
ENV NODE_ENV production
RUN yarn add file:/usr/src/boardgamegeekclient-test/boardgamegeekclient-v${VERSION}.tgz && yarn add jest
# RUN adduser -D apprunneruser
# USER apprunneruser
CMD [ "yarn", "test" ]