From 16795548ed8219bb9df6ce7aa07ef9615126c761 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Tue, 17 Nov 2020 17:01:18 +0500 Subject: [PATCH] Add ability to create multi-arch images. Closes #39, closes #47 --- Dockerfile | 56 ++++++++++++++++++++++++++++++++---------------------- README.md | 2 +- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 763b7483..f2298bb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,43 +1,53 @@ -FROM node:12-alpine AS server-builder - -WORKDIR /app - -RUN apk add vips-dev fftw-dev build-base python --no-cache \ - --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community/ \ - --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/main/ - -COPY server/package.json server/package-lock.json ./ - -RUN npm i --prod --silent - -FROM node:12-alpine AS client-builder +FROM node:14 AS client-builder WORKDIR /app COPY client/package.json client/package-lock.json ./ -RUN npm i --silent +RUN npm install COPY client . RUN npm run build -FROM node:12-alpine - -RUN apk add bash vips --no-cache \ - --repository https://alpine.global.ssl.fastly.net/alpine/v3.10/community/ +FROM node:14-alpine WORKDIR /app -COPY --from=server-builder /app/node_modules node_modules COPY server . -COPY --from=client-builder /app/build public -COPY --from=client-builder /app/build/index.html views COPY docker-start.sh start.sh -RUN chmod +x start.sh +ARG VIPS_VERSION=8.10.2 -ENV BASE_URL DATABASE_URL +RUN apk -U upgrade \ + && apk add \ + bash giflib glib lcms2 libexif \ + libgsf libjpeg-turbo libpng librsvg libwebp \ + orc pango tiff \ + --repository https://alpine.global.ssl.fastly.net/alpine/latest-stable/community/ \ + --repository https://alpine.global.ssl.fastly.net/alpine/latest-stable/main/ \ + --no-cache \ + && apk add \ + build-base giflib-dev glib-dev lcms2-dev libexif-dev \ + libgsf-dev libjpeg-turbo-dev libpng-dev librsvg-dev libwebp-dev \ + orc-dev pango-dev tiff-dev \ + --virtual vips-dependencies \ + --repository https://alpine.global.ssl.fastly.net/alpine/latest-stable/community/ \ + --repository https://alpine.global.ssl.fastly.net/alpine/latest-stable/main/ \ + --no-cache \ + && wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \ + && cd /tmp/vips-${VIPS_VERSION} \ + && ./configure \ + && make \ + && make install-strip \ + && cd $OLDPWD \ + && rm -rf /tmp/vips-${VIPS_VERSION} \ + && npm install --production \ + && apk del vips-dependencies --purge \ + && chmod +x start.sh + +COPY --from=client-builder /app/build public +COPY --from=client-builder /app/build/index.html views VOLUME /app/public/user-avatars VOLUME /app/public/project-background-images diff --git a/README.md b/README.md index 9bd6c538..40f25f96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Planka -![David (path)](https://img.shields.io/david/plankanban/planka?path=client) ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/meltyshev/planka) ![Docker Pulls](https://img.shields.io/docker/pulls/meltyshev/planka) ![GitHub](https://img.shields.io/github/license/plankanban/planka) +![David (path)](https://img.shields.io/david/plankanban/planka?path=client) ![Docker Pulls](https://img.shields.io/docker/pulls/meltyshev/planka) ![GitHub](https://img.shields.io/github/license/plankanban/planka) A Trello-like kanban board built with React and Redux.