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"]