1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-08-05 02:45:18 +02:00

optimize Dockerfile cache use for client build

This commit is contained in:
François Darveau 2021-06-27 15:28:14 -04:00
parent 122ace346d
commit d60dc5cc31
2 changed files with 15 additions and 4 deletions

View file

@ -24,6 +24,7 @@ jobs:
VERSION=${{github.head_ref}}
fi
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${{ steps.date.outputs.date }}"
echo ${TAGS}
echo ::set-output name=tags::${TAGS}
- name: Set up QEMU

View file

@ -2,17 +2,27 @@ FROM node:14-alpine
RUN apk update && apk add --no-cache nano curl
# Get package.json and install modules
COPY package*.json /tmp/package.json
RUN cd /tmp && npm install --production
RUN mkdir -p /app && cp -a /tmp/node_modules /app/
# Get package.json and install modules
COPY client/package*.json /tmp_client/package.json
RUN cd /tmp_client && npm install --production
RUN mkdir -p /app/client && cp -a /tmp_client/node_modules /app/client/
WORKDIR /app
COPY package*.json ./
#COPY package*.json ./
RUN npm install --production
#RUN npm install --production
COPY . .
COPY . /app
RUN mkdir -p ./public ./data \
&& cd ./client \
&& npm install --production \
#&& npm install --production \
&& npm run build \
&& cd .. \
&& mv ./client/build/* ./public \