Cache yarn install during docker builds to improve subsequent build speeds

This commit is contained in:
hgw 2023-12-10 04:51:32 +00:00
parent 36e43b313b
commit 4c87370e64
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4

View File

@ -4,10 +4,10 @@ RUN apk add --no-cache --virtual=build-dependencies build-base git python3-dev &
USER node USER node
WORKDIR /var/opt/hardlounge-src WORKDIR /var/opt/hardlounge-src
ENV THELOUNGE_HOME /var/opt/hardlounge ENV THELOUNGE_HOME /var/opt/hardlounge
COPY package.json yarn.lock .
RUN yarn install
COPY . . COPY . .
#RUN git clone https://git.supernets.org/supernets/hardlounge.git --depth 1 . RUN NODE_ENV=production yarn build && \
RUN yarn install && \
NODE_ENV=production yarn build && \
yarn link && \ yarn link && \
yarn --non-interactive cache clean && \ yarn --non-interactive cache clean && \
ln -s /var/opt/hardlounge-src/index.js /var/opt/hardlounge-src/hardlounge ln -s /var/opt/hardlounge-src/index.js /var/opt/hardlounge-src/hardlounge