mirror of
https://github.com/pawelmalak/flame.git
synced 2025-08-05 10:55:17 +02:00
optimize Dockerfile cache use for client build
This commit is contained in:
parent
122ace346d
commit
d60dc5cc31
2 changed files with 15 additions and 4 deletions
1
.github/workflows/docker-image.yml
vendored
1
.github/workflows/docker-image.yml
vendored
|
@ -24,6 +24,7 @@ jobs:
|
||||||
VERSION=${{github.head_ref}}
|
VERSION=${{github.head_ref}}
|
||||||
fi
|
fi
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${{ steps.date.outputs.date }}"
|
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${{ steps.date.outputs.date }}"
|
||||||
|
echo ${TAGS}
|
||||||
echo ::set-output name=tags::${TAGS}
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
|
18
Dockerfile
18
Dockerfile
|
@ -2,17 +2,27 @@ FROM node:14-alpine
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache nano curl
|
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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
#COPY package*.json ./
|
||||||
|
|
||||||
RUN npm install --production
|
#RUN npm install --production
|
||||||
|
|
||||||
COPY . .
|
COPY . /app
|
||||||
|
|
||||||
RUN mkdir -p ./public ./data \
|
RUN mkdir -p ./public ./data \
|
||||||
&& cd ./client \
|
&& cd ./client \
|
||||||
&& npm install --production \
|
#&& npm install --production \
|
||||||
&& npm run build \
|
&& npm run build \
|
||||||
&& cd .. \
|
&& cd .. \
|
||||||
&& mv ./client/build/* ./public \
|
&& mv ./client/build/* ./public \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue