Skip to content

Commit

Permalink
Merge pull request #170 from banerjeesoumya/main
Browse files Browse the repository at this point in the history
Added a Docker Compose Configuration for Full-Stack Application
  • Loading branch information
Abhishek-Mallick authored Oct 26, 2024
2 parents 12fdb45 + ee1927c commit b3e614c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ __pycache__/
.dist/
scaffold/
bin/format/
venv/
venv/
dist/
24 changes: 23 additions & 1 deletion template/FullStack/React(Frontend)+Nodejs(Backend)/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ This repository provides a simple FullStack template for building modern web app
- **MongoDB**: A NoSQL database known for its flexibility and scalability.
- **Mongoose**: An elegant MongoDB object modeling for Node.js.

### Devops

- **Docker** : Docker is an open-source containerization platform by which you can pack your application and all its dependencies into a standardized unit called a container

## Installation
1. **Populate the .env.example file**:

Expand Down Expand Up @@ -95,7 +99,25 @@ The application uses MongoDB for storing user information. The `users` collectio
- **emailid**: String, unique, cannot be null.
- **password**: String, hashed, cannot be null.


## Instant Docker Setup

> **Note :** You should have [Docker](https://docs.docker.com/get-started/get-docker/) installed on your machine and it should be online
- **Run the following command (Docker compose gets automatically downloaded with Docker Desktop) :**

```bash
docker-compose up
```

- **Access the application :**

Visit `http://localhost:80/` in your web browser.

## Architecture config :

![architecture](https://github.com/user-attachments/assets/1f6de5a6-4bf8-4832-a48d-e129172258a8)
---

Made using [Universal-Box](https://github.com/Abhishek-Mallick/universal-box)

Made using [Universal-Box](https://github.com/Abhishek-Mallick/universal-box)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.8'

services:
mongodb:
image: mongo
container_name: mongodb_uni
ports:
- "27017:27017"
volumes:
- mongodb_template_data:/data/db

backend:
build:
context: ./server
dockerfile: Dockerfile
container_name: univ_template_nodejs_server
depends_on:
- mongodb
ports:
- "3000:3000"
environment:
MONGO_URL: mongodb://mongodb_uni:27017/uni
JWT_SECRET: jwt_secret

frontend:
build:
context: ./client
dockerfile: Dockerfile
container_name: univ_template_react_client
depends_on:
- backend
ports:
- "80:80"
environment:
REACT_APP_BASE_URL: http://localhost:3000

volumes:
mongodb_template_data:

0 comments on commit b3e614c

Please sign in to comment.