A GUI to supervise Docker Swarm.
# With npm
npm test
# Without npm
go test `go list ./... | grep -v tests`
Requires some config like an ETCD local installation, Swarm Manager and Swarm Agents. Can be easily achieved via ansible playbooks included.
# With npm
npm run test-integration
# Without npm
go test ./tests/integration/...
Docker Commander uses Go in backend and React in front. React is managed by NPM so you need it installed and npm scripts to run Browserify:
git clone https://github.com/sayden/docker-commander.git
cd docker-commander
npm install #will trigger npm run browserify
go run main.go
Open localhost:8000 to show the mocked server. You can then tweak config/config.go
to fit your needs.
Requirements file for the MVP project can be found on REQUIREMENTS.md
Maintains state of the app and connected Swarm agents in cluster. Currently there is implementation for ETCD and Consul and their hosts must be written in config/config.go file
NOTE: Consul client API needs hosts without 'http://' prefix as it already uses it
- Watch 2 events:
- New Agent in cluster: Emits
new-agent
event in server - Agent down in cluster: Emits
kill-agent
event in server
- New Agent in cluster: Emits
Will be used by server to make REST connections to Swarm Agents and Manager and return JSON info "as is" back to front via web-socket.
An API via socket layer to communicate real-time with front. Because it's bi-directional it is described as follows:
cluster
: Returns a json with the entire cluster state. Mainly used when a client has just connected to the appagent:containers
: ReplicatesGET /containers/json
. Needs image IP and optional parameters like in Docker APIagent:images
: ReplicatesGET /images/json
new-agent
: When a new Swarm Agent has joined the clusterkill-agent
: When an already existing Swarm Agent has left the cluster
Front is done using React + Redux + Material-Ui. The following actions are defined in Redux store actions file