Skip to content
프로젝트

steveholgado/nextjs-docker-pm2-nginx

GitHub에서 보기

소개

Docker, PM2, NGINX를 사용하는 Next.js

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
0

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Next.js with Docker, PM2 and NGINX

This project is a production Docker setup for a Next.js app.

The Next.js app is launched with PM2 Runtime, which is a Production Process Manager for Node.js applications and is used to keep the app alive forever.

A second container with the NGINX web server is used as a reverse proxy, and to handle HTTP caching.

Tutorial

Follow a tutorial to build this application

Docker Compose

docker-compose up

NGINX listens on port 80, which is the default HTTP port, so you can just visit http://localhost/

Without Docker Compose

# Build images
docker build --tag nextjs-image .
docker build --tag nginx-image ./nginx

# Create shared network
docker network create my-network

# Run containers
docker run --network my-network --name nextjs-container nextjs-image
docker run --network my-network --link nextjs-container:nextjs --publish 80:80 nginx-image

Next.js container is referenced inside NGINX container as nextjs.

PM2 commands

PM2 commands can still be used inside a container with the docker exec command:

docker exec -it <container-id> pm2 monit          # Monitoring CPU/Usage of each process
docker exec -it <container-id> pm2 list           # Listing managed processes
docker exec -it <container-id> pm2 show           # Get more information about a process
docker exec -it <container-id> pm2 reload all     # 0sec downtime reload all applications

관련 프로젝트 살펴보기

불러오는 중…