Skip to content

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

Notifications You must be signed in to change notification settings

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