Complete Jenkins CI/CD Project
Step 1: Fork a Node.js Repository
Step 2: Set Up GitHub Integration with Jenkins
Step 3: Configure Your Jenkins Pipeline
领英推荐
docker-compose up -d --build
Step 4: Create a Docker Compose File
FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
docker-compose.yml – Create a docker-compose.yml file that defines the services needed. Example docker-compose.yml:
version: '3'
services:
app:
build: .
ports:
- "3000:3000"
environment:
NODE_ENV: production
Step 5: Run the Jenkins Pipeline