npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

docker-manager

v0.4.4

Published

Simple management tool for Docker containers.

Downloads

10

Readme

docker-manager

Simple management tool for Docker containers on Linux.

Installation

Install Docker Manager as global dependency:

# Yarn
sudo yarn global add docker-manager

# npm
sudo npm install -g docker-manager

Install the systemd service to enable auto start after boot:

sudo docker-manager install

If you wish to uninstall the systemd service, run:

sudo docker-manager uninstall

Terminology

Application

Applications are a collection of services that you would like to run. For example, a typical web application has two services, namely a backend and a frontend.

Services

Services are containers that you would like to run. Services are exactly the same as Docker Compose services.

Containers

Containers are runtime instances of an image. Containers are exactly the same as Docker containers.

Images

Images are exactly the same as Docker images.

Configuration

You can define applications in /srv/docker. These applications need to be defined in Docker Compose files. The folder structure should look like this:

/srv/docker
├── application1.yml
├── application2.yml
└── common.yml

The common.yml file is special and can be used to define common networks or volumes. It is required and is always included with other applications. Application definition files can have any name other than common.yml, for example /srv/docker/hello-world.yml.

Take a look at the example section below to see what these application definition files might look like.

Usage

Docker Manager provides two ways of controlling your applications: a CLI and a web interface.

CLI

Docker Manager CLI

docker-manager <command>

Commands:
  docker-manager install                                        Install systemd service
  docker-manager version                                        Displays version information
  docker-manager list                                           Lists applications
  docker-manager services <application>                         List services of an application
  docker-manager start <application> [services..]               Start an application
  docker-manager stop <application> [services..]                Stop an application
  docker-manager restart <application> [services..]             Restart an application
  docker-manager update <application> [services..]              Update an application
  docker-manager status <application> [services..]              Display status of an application           [aliases: ps]
  docker-manager top <application> [services..]                 Display running processes of an application
  docker-manager images <application> [services..]              Display images of an application
  docker-manager logs <application> [services..]                Display logs of an application
  docker-manager exec <application> <service> <command>         Execute a command in the container of a service
  [arguments..]

Options:
  --version  Show version number                                                                               [boolean]
  --help     Show help                                                                                         [boolean]

Web application

TODO

Example

Configuration

/srv/docker
├── common.yml
└── hello-world.yml

The common.yml file:

version: '3'
networks:
    bridge:
        driver: bridge
        ipam:
            driver: default
            config:
                - subnet: 172.20.0.0/16

The hello-world.yml application definition file:

version: '3'
services:
    hello-world-backend:
        image: tutum/hello-world
        restart: unless-stopped
        networks:
            - bridge
    hello-world-frontend:
        image: tutum/hello-world
        restart: unless-stopped
        networks:
            - bridge

Management

# Start all applications
docker-manager start all

# Stop only the frontend service of the hello-world application
docker-manager stop hello-world hello-world-frontend

# Update all applications, this automatically services them if needed
docker-manager update all

# Display status of all services of hello-world
docker-manager status hello-world

# Display logs of the backend service of the hello-world application
docker-manager logs -f hello-world hello-world-backend

# Execute a command in the container of the backend service of the hello-world application
docker-manager exec hello-world hello-world-backend ls -alh
docker-manager exec hello-world hello-world-backend -e test=123 sh -c "echo \$test"