Giter VIP home page Giter VIP logo

docker-compose-makefile's Introduction

Docker compose makefile

Build Status Release Commits since last release Github All Releases GitHub issues GitHub pull requests license GitHub stars

Template and lib for docker-compose

INSTALLATION

INSTALLATION

To install mk-lib run command

curl -sL https://git.io/vh4Gn | sh

UPGRADE

To upgrade existing mk-lib run command

make mk-upgrade

USAGE

Screen

Common (see samples)

  • make console - open container's console

From Makefile.minimal.mk (see samples)

  • make start - start all containers
  • make start c=hello - start container hello
  • make stop - stop all containers
  • make status - show list of containers with statuses
  • make logs - show logs
  • make clean - clean all data

From this library

  • make help - show help (see above)
  • make mk-upgrade - check for updates of mk-lib
  • make mk-version - show current version of mk-lib

VARIABLES

  • ROOT_DIR - full path to dir with Makefile
  • MK_DIR - fill path to .mk-lib dir
  • DOCKER_COMPOSE - docker-compose executable command
  • DOCKER_COMPOSE_FILE - docker-compose.yml file

SAMPLES

Basic commands (you can copy and paste it into your Makefile)

up: ## Start all or c=<name> containers in foreground
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c)

start: ## Start all or c=<name> containers in background
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up -d $(c)

stop: ## Stop all or c=<name> containers
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)

status: ## Show status of containers
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) ps

restart: ## Restart all or c=<name> containers
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) stop $(c)
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) up $(c) -d

logs: ## Show logs for all or c=<name> containers
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) logs --tail=100 -f $(c)

clean: confirm ## Clean all data
	@$(DOCKER_COMPOSE) -f $(DOCKER_COMPOSE_FILE) down

You may see samples here

CUSTOMIZATION

You can create .make.env file in directory with Makefile or current directory

Available variables

  • DOCKER_COMPOSE = {docker-compose executable command}
  • DOCKER_COMPOSE_FILE = {custom docker-compose.yml file}

TO-DO

  • check dependencies
  • update readme

CHANGELOG

See CHANGELOG

LICENSE

MIT (see LICENSE)

AUTHOR

Roman Kudlay ([email protected])

docker-compose-makefile's People

Contributors

krom avatar roman-kudlay-lodoss avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.