Public Repository

Last pushed: 2 years ago
Short Description
Docker orchestration tool
Full Description

Town

Town help you run multi-container application in Docker. Defining a single cluster configuration file.

Town is small and simple tool help small startups run they infrastructure very quickly.

Example

Main configuration file is /etc/town/town.yaml It describe separate containers and container relationship itself.

application:
  cluster:
   - "www: 1"
   - "redis: 1"
   - "nginx: 1"

redis:
  image: redis
  environment:
   - REDIS_PASS=secretpassword

www:
  image: node
  command: ${SCALE_INDEX}
  links:
   - redis
  volumes:
   - /var/log/www-${SCALE_INDEX}/log/:/var/log/nodejs

nginx:
  image: nginx
  privileged: true
  environment:
    - WWW_HOSTS=${WWW_HOSTS}
  ports:
   - "80:80"
  links:
   - node
  volumes:
    - /opt/public:/opt/static/

To Run town simple execute command:

town run

Configuration Reference

The configuration file /etc/town/town.yaml has list of containers names. The application item is reserved keyword and used for cluster definition. Here you can define how many instances of containers town needs to create.

Each container must have image key. The keys command, environment and volume can containe dynamic variables:

  • ${SCALE_INDEX} - Index of given container. Start from 1.
  • ${(container_name)_HOSTS} - Comma separated list of hosts.

image

Docker image definition.

command

Override default command of the container.

links

Link to container in another service. Link is the name of other containers and will be dynamicly added depends of the container scale.

ports

Expose ports.

environment

List of environments variables passed to container.

volumes

Mount paths as volumes.

Commands Reference

run

Run containers. If the container is already running nothing will happend. But if the conatiner has new image, town will catch it and restart this container and all refer to it.

restart

Restart all cluster. This operation will gracefully shutdown, remove containers and start from sratch whole cluster.

stop

Stop and remove all containers.

Creators

Kiril Menshikov - https://twitter.com/kiril

Arturs Licis - https://twitter.com/arturs_li

Copyright and license

Code and documentation copyright 2015 Lookify.co Code released under the Apache 2.0 license.

Docker Pull Command
Owner
lookify

Comments (0)