From 69fd6483de52ff60dd3a47d256565dd4124b2e3d Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 22 Apr 2024 02:29:22 +0100 Subject: [PATCH] xi --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3168b62..d79ca41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,13 @@ RUN apk add --no-cache libc6-compat WORKDIR /app # Install dependencies based on the preferred package manager -COPY package.json pnpm-lock.yaml* ./ -RUN pnpm install --frozen-lockfile +COPY 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 corepack enable pnpm && pnpm i --frozen-lockfile; \ + else echo "Lockfile not found." && exit 1; \ + fi # Rebuild the source code only when needed