Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Codebmk committed Jan 23, 2025
1 parent 39ca4bd commit 6e5b738
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions netmanager-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
# Use the official Node.js image as a base
FROM node:18
FROM node:18-alpine AS builder

# Set the working directory
WORKDIR /app

COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install
RUN npm ci

# Copy the rest of the application code
COPY . .

RUN npm run build

# Add healthcheck
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1

USER node

# Expose the application port
EXPOSE 3000

# Command to run the application
CMD ["npm", "start"]
CMD ["npm", "run", "start"]

0 comments on commit 6e5b738

Please sign in to comment.