hrms-api-org/docker/Dockerfile
Suchin Sapphasitthatha 83bf892997 rollback node to v20 lts
2025-08-05 05:50:25 +00:00

34 lines
614 B
Docker

# Build Stage
FROM node:20.19.4-alpine AS build-stage
# Create app directory
WORKDIR /app
# Install app dependencies
COPY package*.json ./
RUN npm ci
# Copy source files and build the app
COPY . .
RUN npm run build
# Production Stage
FROM node:20.19.4-alpine
ENV NODE_ENV=production
USER node
# Create app directory
WORKDIR /app
# Copy built app from build stage
COPY --from=build-stage /app/dist ./dist
# Install only production dependencies
COPY package*.json ./
RUN npm ci --production
# Define the entrypoint and default command
# If you have a custom entrypoint script
CMD [ "node", "dist/app.js" ]