Improved the image creation and reduced final size from 718MB to 241MB.

This commit is contained in:
null31 2020-08-21 12:35:16 -03:00
parent d042fc5810
commit 440107e58a
No known key found for this signature in database
GPG Key ID: CAB4CF4EE49720FF
1 changed files with 8 additions and 7 deletions

View File

@ -8,16 +8,17 @@ WORKDIR /usr/src/lolisafe
COPY package.json yarn.lock ./
RUN apk add --no-cache --virtual build-dependencies python make g++ && apk add --no-cache ffmpeg
RUN apk --no-cache update \
&& apk add --no-cache --virtual build-dependencies python make g++ \
&& apk add --no-cache ffmpeg \
&& apk del build-dependencies \
&& yarn install --production \
&& yarn cache clean
ADD config.sample.js config.js
RUN yarn install
RUN apk update
RUN apk del build-dependencies
COPY . .
EXPOSE 9999
CMD ["node", "lolisafe.js"]