Jacc targets the following user case:
Jacc is NOT a Heroku type architeture with support for remote deployment. You are required to login to the server that hosts the web applications.
Jacc is a private cloud built from standard components such as docker.io, hipache and redis-dns. Docker is a linux containers architecture and hipache a high perforamnce web proxy. redis-dns provides an internal DNS between containers. Docker and hipache are provided by the team behind the dotCloud service.
The goal is to provide an architecture suitable for hosting a variety of components on a limited amount of server. Examples of components could be web applications build in PHP/Java/NodeJS/Ruby/Python etc. It could also include databases, caching systems, queue management etc. The limit is really only what's runs on the Linux flavours that docker supports.
sudo npm install jacc -g
sudo apt-get install -y redis-server
sudo apt-get install -y supervisor(or with
sudo pip install supervisorbut then you need to setup supervisor as a service yourself)
JACC_HOME/etc/redis-dns-config.jsonwith the IP adress of the docker bridge (do
ifconfig|grep -A 1 docker).
commandsection in the files
JACC_HOME/etc/supervisor/*.confwith the path to the jacc installation
sudo cp JACC_HOME/etc/supervisor/*.conf /etc/supervisor/conf.d/ && sudo supervisorctl reload
sudo supervisorctl status
jacc add <IMAGE_ID> <URL> <internal port> <DNS>followed by
./jacc.sh updateto add an image and start a container. hipache and redis-dns configuration will be updated at the same time
docker run -d -dns=IP IMAGE_ID
jacc listshows the configuration and
jacc statusthe running containers
docker need to be configured to open up the HTTP API. The start script needs to include this flag
For ubuntu, this is changed in
/etc/init/docker.conf. Now the docker command line tool needs the flag
an alias for simplcity:
alias docker='docker -H=tcp://127.0.0.1:4243'. Place this in your
NOTE: The overall design principle for Jacc is to re-use what's already out there. Don't re-invent the wheel.
An easy way to get started quickly is to create a virtual machine using Vagrant. This repo has everything you need: https://github.com/colmsjo/docker. You can of course setup docker and the other required modules yourself.
make install to install everything in the current directory.
Jacc comes with a test suite. The first step when developing is to make sure that the test runs without any erros.
A number of environment variables needs to be set. You can for instance use the
./test/setenv.template file showed below:
export JACC_TEST_CONTAINERID=$abcdefghijklexport JACC_TEST_URL="app1.jacc.local"export JACC_TEST_PORT="80"export JACC_TEST_DNS="app1.local"
source ./test/setenv followed by
make to kickoff the test suite.
curl http://localhost:4243/containers/jsonshow containers?