Skip to content

Commit

Permalink
Merge pull request #35 from ParthDhavan04/ParthDhavan04
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
anshikasrivastava17 authored Jul 22, 2024
2 parents 0039805 + 1663d73 commit 09c7c4c
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Day 1/Issue 1/Parth/Docker_Integration/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build Docker image
run: docker build -t parthdhavan04/docker_ci:latest .

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push Docker image
run: docker push parthdhavan04/docker_ci:latest
13 changes: 13 additions & 0 deletions Day 1/Issue 1/Parth/Docker_Integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD [ "node", "index.js" ]
11 changes: 11 additions & 0 deletions Day 1/Issue 1/Parth/Docker_Integration/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;

app.get("/", (req, res) => {
res.send("Hello");
});

app.listen(port, () => {
console.log(`Server running on port ${port}`);
});
13 changes: 13 additions & 0 deletions Day 1/Issue 1/Parth/Docker_Integration/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Day 1/Issue 1/Parth/Docker_Integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "docker_integration",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09c7c4c

Please sign in to comment.