hrms-api-salary/docker/Dockerfile
2025-09-16 01:15:26 +07:00

36 lines
644 B
Docker

# Build Stage
FROM node:22.17.1-alpine AS build-stage
# Create app directory
WORKDIR /app
# Install app dependencies
COPY package*.json ./
RUN npm install
# Copy source files and build the app
COPY . .
#RUN npm ci
RUN npm run build
# Production Stage
FROM node:lts-alpine
ENV NODE_ENV production
# 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
RUN npm install
USER node
# Define the entrypoint and default command
# If you have a custom entrypoint script
CMD [ "node", "dist/app.js" ]