test build
This commit is contained in:
parent
41c97e5f12
commit
16426f1d0b
1 changed files with 8 additions and 5 deletions
|
|
@ -16,18 +16,21 @@ RUN npm run build
|
|||
# Production Stage
|
||||
FROM node:lts-alpine
|
||||
|
||||
ENV NODE_ENV production
|
||||
USER node
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Create app directory
|
||||
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 --from=build-stage /app/dist ./dist
|
||||
|
||||
# Install only production dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install --production
|
||||
# Change ownership to node user and switch to node user
|
||||
RUN chown -R node:node /app
|
||||
USER node
|
||||
|
||||
# Define the entrypoint and default command
|
||||
# If you have a custom entrypoint script
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue