docker: Cache system dependencies installation

This commit is contained in:
Elian Doran 2024-07-13 11:14:32 +03:00
parent 0a7fcf399f
commit 9b88228be9
No known key found for this signature in database

View File

@ -1,6 +1,18 @@
# !!! Don't try to build this Dockerfile directly, run it through bin/build-docker.sh script !!!
FROM node:18.18.2-alpine
# Configure system dependencies
RUN apk add --no-cache --virtual .build-dependencies \
autoconf \
automake \
g++ \
gcc \
libtool \
make \
nasm \
libpng-dev \
python3
# Create app directory
WORKDIR /usr/src/app
@ -11,16 +23,6 @@ COPY server-package.json package.json
# Install app dependencies
RUN set -x \
&& apk add --no-cache --virtual .build-dependencies \
autoconf \
automake \
g++ \
gcc \
libtool \
make \
nasm \
libpng-dev \
python3 \
&& npm install \
&& apk del .build-dependencies \
&& npm run webpack \