1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

Improve Docker cache efficiency and fix signal handling

This commit is contained in:
Lorenz Brun 2022-02-08 12:15:52 +01:00 committed by GitHub
parent 670e964be5
commit da9878f220
2 changed files with 16 additions and 12 deletions

View file

@ -2,21 +2,22 @@ FROM node:lts AS client-builder
WORKDIR /app WORKDIR /app
COPY client . COPY client/package.json client/package-lock.json ./
RUN npm install npm@latest --global \ RUN npm install npm@latest --global \
&& npm install \ && npm install
&& npm run build
COPY client .
RUN npm run build
FROM node:lts-alpine FROM node:lts-alpine
WORKDIR /app WORKDIR /app
COPY server . COPY server/.npmrc server/package.json server/package-lock.json ./
COPY docker-start.sh start.sh
ARG ALPINE_VERSION=3.12 ARG ALPINE_VERSION=3.15
ARG VIPS_VERSION=8.10.2 ARG VIPS_VERSION=8.12.2
RUN apk -U upgrade \ RUN apk -U upgrade \
&& apk add \ && apk add \
@ -43,8 +44,11 @@ RUN apk -U upgrade \
&& rm -rf /tmp/vips-${VIPS_VERSION} \ && rm -rf /tmp/vips-${VIPS_VERSION} \
&& npm install npm@latest --global \ && npm install npm@latest --global \
&& npm install --production \ && npm install --production \
&& apk del vips-dependencies --purge \ && apk del vips-dependencies --purge
&& chmod +x start.sh
COPY docker-start.sh start.sh
RUN chmod +x start.sh
COPY server .
COPY --from=client-builder /app/build public COPY --from=client-builder /app/build public
COPY --from=client-builder /app/build/index.html views COPY --from=client-builder /app/build/index.html views

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
set -e
node db/init.js \ node db/init.js
&& node app.js --prod $@ exec node app.js --prod $@