Skip to content

Commit

Permalink
Merge pull request #59 from Ratangulati/fix-issue-58
Browse files Browse the repository at this point in the history
Integrated Dockerfile
  • Loading branch information
jatiinyadav authored Jul 14, 2024
2 parents 472482f + 289ea6e commit cc0fde5
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 1 deletion.
34 changes: 34 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Table of Contents
- [Required Tools](#required-tools)
- [Installation using Docker](#with-docker)
- [Frontend Installation](#frontend-installation)
- [1. Clone the Repository](#1-clone-the-repository)
- [2. Open Project in Visual Studio Code](#2-open-project-in-visual-studio-code)
Expand All @@ -27,6 +28,39 @@ Before proceeding with the installation, ensure that you have the necessary tool

Once you have all the required tools installed, you can proceed with the installation of the project.


#### With Docker

Clone the Crew Connect repository from GitHub.
```bash
git clone https://github.com/jatiinyadav/Crew-Connect.git
```

![Clone Repository](./images/installation/step-1.png)

#### 2. Open Project in Visual Studio Code

Navigate to the project directory and open it in Visual Studio Code.
```bash
cd Crew-Connect
code .
```

![Open in Visual Studio Code](./images/installation/step-2.png)

#### 3. Run Docker Compose

Navigate to the project directory and open it in Visual Studio Code.
```bash
docker-compose up
```

Your Frontend is now running at [localhost:4200](http://localhost:4200/)
Your Backend is now running at [localhost:80](http://localhost:80/)


#### Without Docker

### Frontend Installation

#### 1. Clone the Repository
Expand Down
6 changes: 6 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
.DS_Store
.env
.git
.gitignore
22 changes: 22 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build

WORKDIR /src

COPY ["ChatApplication.sln", "./"]
COPY ["MongoDLL/MongoDLL.csproj", "MongoDLL/"]
COPY ["SignalRLearning/SignalRLearning.csproj", "SignalRLearning/"]
RUN dotnet restore

COPY . .

RUN dotnet publish -c Release -o /app/publish

FROM mcr.microsoft.com/dotnet/aspnet:6.0

WORKDIR /app

COPY --from=build /app/publish .

EXPOSE 80

ENTRYPOINT ["dotnet", "SignalRLearning.dll"]
36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: '3.8'

services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "4200:4200"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules

backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- mongodb
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ConnectionStrings__MongoDB=mongodb://mongodb:27017/ChatApplication

mongodb:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db

volumes:
mongodb_data:
6 changes: 6 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
.DS_Store
.env
.git
.gitignore
13 changes: 13 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 4200

CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"start": "ng serve --host 0.0.0.0",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
Expand Down

0 comments on commit cc0fde5

Please sign in to comment.