Skip to content

nicokempe/docker-deploy-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Auto-Update Agent

This project provides an automatic update agent for Docker-based applications in restricted network environments. The agent periodically checks for new application versions and updates the running containers accordingly.

Prerequisites

  • Node.js v16 or higher
  • Docker and Docker Compose
  • GitHub Personal Access Token with package:read permissions

Installation

  1. Clone the repository:
nke@alpine:~$ git clone https://github.com/nicokempe/docker-deploy-agent.git
nke@alpine:~$ cd docker-deploy-agent
  1. Install the dependencies:
nke@alpine:~$ npm install
  1. Create a .env file and add your GitHub credentials and repository information:
GITHUB_USER_NAME=your_name
GITHUB_USER_MAIL=your_mail
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_REPO_OWNER=repository_organization
GITHUB_REPO_NAME=repository_name
PACKAGE_NAME=package_name
PACKAGE_TYPE=container
CHECK_INTERVAL=900000
DOCKER_AGENT_IMAGE=repo_owner/repo_name
DOCKER_AGENT_TAG=your_tag

Don't forget to list the .env file in the .gitignore to avoid accidentally committing it to your repository.

  1. Build the agent container, configure it in the .env file and start it with Docker Compose:
nke@alpine:~$ docker build -t your_repo_owner/your_repo_name:your_tag .
nke@alpine:~$ docker-compose up -d

Docker Hub Repository

The agent container is also available on Docker Hub at https://hub.docker.com/r/nicokempe/docker-deploy-agent. You can pull the image using:

nke@alpine:~$ docker pull nicokempe/docker-deploy-agent

Usage

The agent runs as a standalone Docker container and periodically checks for updates to your application. When an update is available, the agent performs a zero-touch deployment, updating the application to the latest version. If the update fails, the agent features a rollback function to revert to the previous version.

Customization

You can customize the agent to suit your specific requirements by modifying the configuration in the .env file and the code in the src files. Please make sure to thoroughly test any changes before deploying them in a production environment.

License

This project is licensed under the MIT License. For more information, see the LICENSE

About

⬆️ Automatic update agent for Docker-based applications on constrained networks.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published