-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.buildtest.react
19 lines (17 loc) · 1010 Bytes
/
Dockerfile.buildtest.react
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM node:16-alpine@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b AS packer
WORKDIR /usr/src/boardgamegeekclient-packfase
COPY . .
RUN yarn pack
FROM node:16-alpine@sha256:60ef0bed1dc2ec835cfe3c4226d074fdfaba571fd619c280474cc04e93f0ec5b AS reactbuilder
ARG VERSION
RUN echo "received: ${VERSION}"
WORKDIR /usr/src/boardgamegeekclient-test
COPY --from=packer /usr/src/boardgamegeekclient-packfase/boardgamegeekclient-v${VERSION}.tgz .
COPY --from=packer /usr/src/boardgamegeekclient-packfase/buildtest/react/start.sh .
RUN npm init vite react-test -- --template react && cd react-test && npm install && npm install file:/usr/src/boardgamegeekclient-test/boardgamegeekclient-v${VERSION}.tgz
COPY --from=packer /usr/src/boardgamegeekclient-packfase/buildtest/react/App.jsx ./react-test/src
RUN cd react-test && npm run build
FROM nginx:alpine
COPY --from=reactbuilder /usr/src/boardgamegeekclient-test/react-test/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]