From 1f2a18a4ae7030ed9fee1287df9236f0e7f2db20 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Tue, 13 Nov 2018 13:35:29 +0100 Subject: [PATCH] added a Dockerfile for the automated builds of Docker Hub --- Dockerfile.automated | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Dockerfile.automated diff --git a/Dockerfile.automated b/Dockerfile.automated new file mode 100644 index 000000000..8df0aeb38 --- /dev/null +++ b/Dockerfile.automated @@ -0,0 +1,42 @@ +FROM resin/armv7hf-debian-qemu AS armBin + + +FROM arm32v6/node:8-alpine as builder +COPY --from=armBin /usr/bin/cross-build-start /usr/bin/ +COPY --from=armBin /usr/bin/cross-build-end /usr/bin/ +COPY --from=armBin /usr/bin/qemu-arm-static /usr/bin/ +COPY --from=armBin /usr/bin/resin-xbuild /usr/bin/ +RUN [ "cross-build-start" ] +RUN apk add -U build-base python +WORKDIR /usr/src/app +COPY . /usr/src/app +RUN npm install --production --ignore-scripts --prefer-offline +RUN [ "cross-build-end" ] + + +FROM arm32v6/node:8-alpine +LABEL maintainer="butlerx@notthe.cloud" +LABEL maintainer="marc.ammon@fau.de" + +ENV PORT=3000 +ENV SSHHOST=localhost +ENV SSHPORT=22 + +WORKDIR /usr/src/app +ENV NODE_ENV=production +COPY --from=armBin /usr/bin/cross-build-start /usr/bin/ +COPY --from=armBin /usr/bin/cross-build-end /usr/bin/ +COPY --from=armBin /usr/bin/qemu-arm-static /usr/bin/ +COPY --from=armBin /usr/bin/resin-xbuild /usr/bin/ +RUN [ "cross-build-start" ] +RUN apk add -U openssh-client sshpass +COPY --from=builder /usr/src/app/dist /usr/src/app/dist +COPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules +COPY package.json /usr/src/app +COPY index.js /usr/src/app +RUN mkdir ~/.ssh +RUN ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts +RUN [ "cross-build-end" ] +EXPOSE $PORT + +ENTRYPOINT [ "node", "." ]