Package: aplite
Simple tool for managing the docker containers dependency suitable for
local development envorionment.Current version:noneRelease date:not released yetLicense:MITIntroductionThis tool has been created to manage your docker containers while you
developing an application especially when it uses depending services and
each service is running in a separate container. For example, imagine
you have a microservices architecture and want to work on one of the
services but to run it on your local machine you may have to run other
services at the same time to get it working properly. You could still
use docker-compose tool but it is not as flexible and easy to manage
when it comes to choose which services you want to run at the moment.Using aplite you can: - run a docker container with all it’s depending
containers using a single command - stop any container (or pause) and
start again any time without touching any other containers - run only
depending containers which are needed to run for the project you working
on (don’t need to run whole architecture at the same time) - add extra
tasks when container starts or stop using apltie configuration fileInstallationThere are no special requirements apart from having Docker installed on
your machine. Then to install aplite you need to run these commands:$wgethttps://gitlab.com/barell/aplite/master.zip$sudounzipmaster.zip/etc$sudosymlink/usr/bin/aplite/etc/aplite/bin/apliteTo check if aplite has been successfully installed on your computer use:$apliteversionIt should output something like:$aplitev0.1(2017-02-22);docker-api:v1.24You may also want to check if your docker installation is compatible
with aplite (more info to add).Basic UsageTo start using aplite in your project you need to create an
aplite.config file which must contain some basic info about handling
your docker container:name test-project
image php7-apacheIf you put this file inside your project and run$apliteupIt will run a new container using php7-apache image. By default, there
are no files mounted to the image but it can be simply done by adding
mount command to the config file:name test-project
image php7-apache
mount . /var/www/htmlEvery time you change the aplite.config, run the “up” command to re-run
all the containers. To stop all containers, use “down” command:$aplitedownNote: it will only stop containers initialized by aplite. You can also
stop and remove containers by adding the -r flag:$aplitedown-rLinking containersMore complexity is added when your project depends on other services and
you need to run them all. In wich case you need to install all your
services first so aplite can localize them on your machine. When you are
inside your project directory, just run:$apliteinstallFrom now you can use the name of the project (from aplite.config) inside
other project’s configurations. For example, let’s say project-alpha
uses project-bravo. First you need to install both and inside
project-alpha aplite.config add:link project-bravo using project-bravo.comAnd run the up command inside project-alpha, and it will start both
containers. If your code inside project-alpha will call
project-bravo.com, the traffic will be redirected to project-bravo
service.Occasionally you may want your project-alpha directly connect to
project-bravo.com (skipping container running on your machine) in which
case you can just stop project-bravo container:$aplitestopproject-bravoTo start it again, just use start command:$aplitestartproject-bravoYou can use start and stop commands even if you haven’t used up command
before, so you can immidietaly start any of your installed container on
your machine and manually choose which one do you want to run. These
commands will also skip the linking from your configuration files.You can also have multi-depth dependency, where project-bravo could link
to another project and so on. Every time you use up command, all
containers will start automatically so the whole flow will be kept.To see which containers are running and their’s links run the ps
command:$aplitepsServicePortImageproject-alpha8000php7-apache->project-bravo(project-bravo.com)8001php5-apache->project-charlie(charilie.com)8002php7-apacheIssues and feedbackPlease feel free to report any issues or give us some feedback on new
features.