Skip to content

NodeJS Server to deploy docker images on a server

Notifications You must be signed in to change notification settings

inquid/server-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy Server Project

Project Logo

Table of Contents


Overview

The Deploy Server Project is a robust Node.js application designed to manage and automate deployment processes using a combination of Express.js, PM2, and Bash scripting. It provides a RESTful API to trigger deployments and monitor their status, ensuring efficient and reliable application updates.

Features

  • Automated Deployments: Trigger deployments via API endpoints.
  • Process Management: Uses PM2 to manage the Node.js server, ensuring high availability and automatic restarts.
  • Comprehensive Logging: Maintains detailed logs of deployment processes for easy monitoring and troubleshooting.
  • System Setup Script: A single Bash script to install necessary dependencies (Node.js, npm, PM2) and configure the server.
  • Git Ignorance: Configured .gitignore to track only essential files, keeping the repository clean.

Prerequisites

Before setting up the project, ensure your system meets the following requirements:

  • Operating System: Ubuntu 18.04 or later
  • User Permissions: Ability to run commands with sudo
  • Existing logs Directory: The logs directory should exist in the project root

Usage

wget https://github.com/inquid/server-deployer/archive/refs/heads/main.zip

unzip main.zip

cd server-deployer-main

chmod +x scripts/setup_and_start.sh
chmod +x scripts/deployer.sh

./scripts/setup_and_start.sh

When live you can do

curl http://localhost:3000/

Response

Deployer service available

Trigger a Deployment via API:

Use curl or any API client (like Postman) to send a POST request.

curl -X POST http://localhost:3000/deploy \
     -H "Content-Type: application/json" \
     -d '{
         "dockerImage": "vendor/image-staging:latest",
         "domain": "yourdomain.com",
         "containerName": "app_container",
         "s3Bucket": "app-container-bucket"
     }'

Check Deployment Status:

curl http://localhost:3000/status
wget https://github.com/inquid/server-deployer/archive/refs/heads/main.zip
sudo apt install unzip
unzip main.zip
cd server-deployer-main
chmod +x scripts/setup_and_start.sh                                       
chmod +x scripts/deployer.sh
sudo ./scripts/setup_and_start.sh

About

NodeJS Server to deploy docker images on a server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published