Skip to content

NE7K/Docker-FastFollow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🐳 Docker Multi-Container Practice

This project demonstrates a Docker-based system composed of three services: a Node.js web server, a PostgreSQL database, and an Nginx reverse proxy. The goal is to simulate a production-ready architecture using Docker Compose and custom configurations.

Docker Hub

The Docker image used in this exercise is available for download at the link above.


🧱 System Architecture

[User Browser] 
     ⇩
localhost:80 (Nginx)
     ⇩
localhost:8080 (Node.js server)
     ⇩
PostgreSQL (Database)
  • Nginx listens on port 80 and forwards HTTP requests to the Node.js server on port 8080.
  • The Node.js server communicates with the PostgreSQL database for application logic and data storage.

πŸ“‚ Project Structure

Create_Image/                              # Dockerλ₯Ό ν™œμš©ν•œ 이미지 생성 ν”„λ‘œμ νŠΈ 루트
β”œβ”€β”€ nginx/                                 # Nginx κ΄€λ ¨ μ„€μ • 폴더
β”‚   β”œβ”€β”€ Dockerfile                         # Nginx용 Docker 이미지 λΉŒλ“œ μ„€μ • 파일
β”‚   └── myconfig1.conf                     # μ‚¬μš©μž μ •μ˜ Nginx μ„€μ • 파일
β”‚
β”œβ”€β”€ node_modules/                          # Node.js μ˜μ‘΄μ„± 폴더 (μžλ™ 생성)
β”‚
β”œβ”€β”€ vol/                                   # λ³Όλ₯¨ 마운트λ₯Ό μœ„ν•œ 폴더
β”‚
β”œβ”€β”€ .dockerignore                          # Docker ignore
β”œβ”€β”€ .env                                   
β”œβ”€β”€ .gitignore                             
β”‚
β”œβ”€β”€ docker-compose.yml                     # μ—¬λŸ¬ μ»¨ν…Œμ΄λ„ˆλ₯Ό μ •μ˜ν•˜λŠ” Compose μ„€μ • 파일
β”œβ”€β”€ Dockerfile                             # Node.js 앱을 μœ„ν•œ Docker 이미지 μ •μ˜
β”‚
β”œβ”€β”€ package-lock.json                      # npm μ˜μ‘΄μ„± κ³ μ • 파일
β”œβ”€β”€ package.json                           # ν”„λ‘œμ νŠΈ 메타정보 및 μ˜μ‘΄μ„± μ •μ˜
β”œβ”€β”€ sever.js                               
β”‚
└── README.md                              

πŸš€ Usage

Start All Services

docker compose up --build

Start Nginx Only (if already built)

docker compose up -d nginx

Optional: Replicated Web Server

# Uncomment in docker-compose.yml
deploy:
  mode: replicated
  replicas: 3

Run with:

docker compose --compatibility up

About

A multi-container Docker project that connects a Node.js server, PostgreSQL, and Nginx to simulate a production-ready web service.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors