Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
added a Dockerfile for the automated builds of Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
mammo0 committed Feb 1, 2020
1 parent 0b66e83 commit 5828776
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions Dockerfile.automated
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM resin/armv7hf-debian-qemu AS armBin


FROM arm32v7/node:dubnium-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 jq
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN yarn add --force package.json && \
yarn build && \
yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")')
RUN [ "cross-build-end" ]


FROM arm32v7/node:dubnium-alpine as builder
LABEL maintainer="[email protected]"
LABEL maintainer="[email protected]"

ENV PORT=3000
ENV SSHHOST=localhost
ENV SSHPORT=22

WORKDIR /usr/src/app
ENV NODE_ENV=production
EXPOSE $PORT
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

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 && \
mkdir ~/.ssh && \
ssh-keyscan -H wetty-ssh >> ~/.ssh/known_hosts
RUN [ "cross-build-end" ]

ENTRYPOINT [ "node", "." ]

0 comments on commit 5828776

Please sign in to comment.