From f65aef07a9c34bca74748a85bf409048e22ad39a Mon Sep 17 00:00:00 2001 From: Muhammad Mairaj Khan Date: Tue, 16 Dec 2025 19:16:34 +0500 Subject: [PATCH] Update Dockerfile --- Dockerfile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5358e56..1bb065e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,28 @@ FROM node:22-alpine + +# Set working directory WORKDIR /app + +# Copy package files COPY package*.json ./ -RUN npm ci --ignore-scripts + +# Install dependencies +# Use npm ci if lock file exists, else fallback to npm install +RUN if [ -f package-lock.json ]; then npm ci --ignore-scripts; else npm install --ignore-scripts; fi + +# Copy rest of the project COPY tsconfig.json ./ COPY src/ ./src/ + +# Build the project RUN npm run build + +# Expose app port EXPOSE 3000 + +# Set production environment ENV NODE_ENV=production + +# Set entrypoint and default command ENTRYPOINT ["node", "build/main/main/cli.js"] -CMD ["http"] \ No newline at end of file +CMD ["http"]