Updated the Dockerfile

This commit is contained in:
Tiago Ribeiro
2023-07-21 10:29:06 +01:00
parent cc4b38fbbd
commit f01794fed8

View File

@@ -8,13 +8,8 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY --link package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
COPY package.json yarn.lock* ./
RUN yarn --frozen-lockfile
# Rebuild the source code only when needed