Start development services from templates
Go to file
2022-09-28 01:36:17 +02:00
bin Renamed serverctl to server 2022-09-28 01:12:53 +02:00
registry Improvements and fixes 2022-09-28 01:11:14 +02:00
src Added --all option to stop command 2022-09-28 01:36:17 +02:00
.gitignore Initial commit 2022-09-27 12:29:56 +02:00
composer.json Renamed serverctl to server 2022-09-28 01:12:53 +02:00
composer.lock Initial commit 2022-09-27 12:29:56 +02:00
LICENSE Improvements and fixes 2022-09-28 01:11:14 +02:00
README.md Added --all option to stop command 2022-09-28 01:36:17 +02:00

ServerCtl - Services for Developers

Todo

  • Add a --temporary option to start to remove volume after stop
  • Rename from serverctl to server
  • Implement variables in environment section
  • Provide environment, ex. ${SERVER_HOST} for docker host IP
  • Add filtering to find command, to seach for tags or name
  • App port binding, i.e. phpmyadmin on 9000, phpcacheadmin on 9001

Examples

Say you need a Mongodb instance for something. Try this:

$ serverctl start mongo
Started mongo<default>
  Mongo client: 27017
$

What just happened? Well, the start command pulled and started a new container from the latest docker image using sensible defaults from the service registry.

Let's start another one:

$ serverctl start mongo --instance other --portoffset 1
Started mongo<other>
  Mongo client: 27018
$

Check it out!

$ serverctl status
Service   Instance   Ports
mongo     default    27017
          other      27018
$ serverctl stop mongo --all
Stopped mongo<default>
Stopped mongo<other>
$

FAQ

Where is the data stored?

  • Data goes in $HOME/.var/serverctl

How can I tell a container to connect to another container?

Static configuration

If you need to preconfigure a connection, use the DOCKER_HOST environment variable. It will only work in the environment section of the service config:

  "environment": {
    "FOO_SERVER": "${DOCKER_HOST}"
  }

From running container

Lookup the IP on your host. On Linux you would do something like:

$ ip addr show docker0
6: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:69:cd:44:2c brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:69ff:fecd:442c/64 scope link 
       valid_lft forever preferred_lft forever