From b92cf4f75c340927a1f4c2a86b21f85df17c0aa5 Mon Sep 17 00:00:00 2001 From: Kalidou Diagne Date: Mon, 21 Apr 2025 14:23:43 +0300 Subject: [PATCH] feat: fix docker config (#337) --- Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23ec5f1..e99e728 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,14 @@ RUN apk add --no-cache git curl WORKDIR /builder +# Enable corepack before any Yarn operations +RUN corepack enable +RUN corepack prepare yarn@4.7.0 --activate + # Copy manifests, lock file, and yarn config COPY package.json yarn.lock .yarnrc.yml ./ -# Enable corepack and install dependencies using the lockfile -RUN corepack enable +# Install dependencies using the lockfile RUN yarn install --immutable # Copy the rest of the application code @@ -22,6 +25,10 @@ FROM node:20-alpine as runner # Add curl for HEALTHCHECK RUN apk add --no-cache curl +# Enable corepack in the runner image too +RUN corepack enable +RUN corepack prepare yarn@4.7.0 --activate + USER node WORKDIR /home/node @@ -35,6 +42,6 @@ EXPOSE ${PORT} # Add internal health check # Adjust path (e.g., /api/health) if necessary for your app's health endpoint HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ - CMD curl --fail http://localhost:${PORT}/ || exit 1 + CMD curl --fail http://localhost:${PORT}/api/health || exit 1 CMD ["yarn", "start"]