You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
867 B
47 lines
867 B
FROM node:14.17-alpine AS BUILD_IMAGE
|
|
|
|
WORKDIR /app
|
|
|
|
ARG TARGETPLATFORM
|
|
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
|
|
|
RUN \
|
|
case "${TARGETPLATFORM}" in \
|
|
'linux/arm64') apk add --no-cache python make g++ ;; \
|
|
'linux/arm/v7') apk add --no-cache python make g++ ;; \
|
|
esac
|
|
|
|
COPY package.json yarn.lock ./
|
|
RUN yarn install --frozen-lockfile --network-timeout 1000000
|
|
|
|
COPY . ./
|
|
|
|
ARG COMMIT_TAG
|
|
ENV COMMIT_TAG=${COMMIT_TAG}
|
|
|
|
RUN yarn build
|
|
|
|
# remove development dependencies
|
|
RUN yarn install --production --ignore-scripts --prefer-offline
|
|
|
|
RUN rm -rf src server
|
|
|
|
RUN touch config/DOCKER
|
|
|
|
RUN echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json
|
|
|
|
|
|
FROM node:14.17-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache tzdata tini
|
|
|
|
# copy from build image
|
|
COPY --from=BUILD_IMAGE /app ./
|
|
|
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
|
CMD [ "yarn", "start" ]
|
|
|
|
EXPOSE 5055
|