test build

This commit is contained in:
kittapath 2025-09-15 22:56:44 +07:00
parent 41c97e5f12
commit 16426f1d0b

View file

@ -16,18 +16,21 @@ RUN npm run build
# Production Stage # Production Stage
FROM node:lts-alpine FROM node:lts-alpine
ENV NODE_ENV production ENV NODE_ENV=production
USER node
# Create app directory # Create app directory
WORKDIR /app WORKDIR /app
# Install only production dependencies as root first
COPY package*.json ./
RUN npm install --production && npm cache clean --force
# Copy built app from build stage # Copy built app from build stage
COPY --from=build-stage /app/dist ./dist COPY --from=build-stage /app/dist ./dist
# Install only production dependencies # Change ownership to node user and switch to node user
COPY package*.json ./ RUN chown -R node:node /app
RUN npm install --production USER node
# Define the entrypoint and default command # Define the entrypoint and default command
# If you have a custom entrypoint script # If you have a custom entrypoint script