Skip to content

Commit

Permalink
feat(cli): dockrize the application
Browse files Browse the repository at this point in the history
  • Loading branch information
MAVRICK-1 authored Jan 1, 2025
1 parent 0cd60a3 commit 9baa888
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Stage 1: Build the application
FROM node:16 AS build

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy the package.json and package-lock.json to install dependencies
COPY package*.json ./

# Install build dependencies
RUN npm install

# Copy the rest of the application source code
COPY . .

# Run any build steps (e.g., transpile or bundle the code)
RUN npm run build # Adjust this according to your build command

# Stage 2: Production image
FROM node:16-slim AS production

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy only the necessary files from the build stage
COPY --from=build /usr/src/app /usr/src/app

# Install production dependencies (optional, if you want to prune dev dependencies)
RUN npm ci --only=production

# Expose the port your app will run on
EXPOSE 3000

# Command to run the application
CMD ["node", "generate-sitemap.js"]

0 comments on commit 9baa888

Please sign in to comment.