Reduce image size

This commit is contained in:
hgw 2023-10-05 09:27:17 +00:00
parent c135b7785a
commit 9b38d85adc
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4
1 changed files with 11 additions and 8 deletions

View File

@ -1,14 +1,17 @@
FROM node:lts-alpine
RUN apk add --no-cache --virtual=build-dependencies build-base git python3-dev
RUN apk add --no-cache yarn
RUN apk add --no-cache --virtual=build-dependencies build-base git python3-dev && \
apk add --no-cache yarn
USER node
WORKDIR /var/opt/thelounge-src
ENV THELOUNGE_HOME /var/opt/thelounge
RUN git clone https://git.supernets.org/supernets/thelounge.git .
RUN yarn install
RUN NODE_ENV=production yarn build
RUN yarn link
RUN yarn --non-interactive cache clean
RUN ln -s /var/opt/thelounge-src/index.js /var/opt/thelounge-src/thelounge
RUN git clone https://git.supernets.org/supernets/thelounge.git --depth 1 .
RUN yarn install && \
NODE_ENV=production yarn build && \
yarn link && \
yarn --non-interactive cache clean && \
ln -s /var/opt/thelounge-src/index.js /var/opt/thelounge-src/thelounge
USER root
RUN apk del --purge build-dependencies
USER node
EXPOSE 9000
CMD ["/var/opt/thelounge-src/thelounge", "start"]