Container Ship
Deployment of containers type master-workers fits for multiple regions, minimum settings, access controls and opening ports.
Try fast start
git clone https://github.com/oxmix/container-ship.git
cd container-ship/example && ./start
- open
http://localhost:3080
Mini Wiki
Add node to a ship
curl -kX POST https://ctr-ship.example.host/nodes/apply --data-binary @- << 'EOF'
IPv4: 127.0.0.1
name: localhost
EOF
cargo-deployer
Connect machine, will be install - Execute on the worker node
curl -sk https://ctr-ship.example.host/connection | sudo bash -
Delete node
- All containers will be destroyed and
cargo-deployer
too
curl -kX DELETE https://ctr-ship.example.host/nodes/apply?name=localhost
Apply deployment manifest
curl -kX POST https://127.0.0.1:8443/deployment --data-binary @- << 'EOF'
space: my-project
name: test-deployment
nodes:
- localhost
containers:
- name: nginx
from: nginx
stop-time: 30
ports:
- 8080:80
EOF
Delete manifest deployment
- All containers of manifest will be destroyed
curl -kX DELETE https://ctr-ship.example.host/deployment?name=my-project.test-deployment
Magic environments
- update node
curl -kX POST https://127.0.0.1:8443/nodes/apply --data-binary @- << 'EOF'
IPv4: 127.0.0.1
name: localhost
variables:
- key: PASS_SEC
val: 32167
EOF
- auto replace in each manifest deployment if set equal node and variables {}
curl -kX POST https://127.0.0.1:8443/deployment --data-binary @- << 'EOF'
space: example
name: magick-envs-deployment
nodes:
- localhost
containers:
- name: nginx
from: nginx
ports:
- 8081:80
environments:
- PASS={PASS_SEC}
EOF
Usage own registry with auto access control by IP nodes
- To raise docker
registry:2
docker run -d --name docker-registry \
--restart always --log-driver json-file --log-opt max-size=5m \
-p 127.0.0.1:5035:5035 \
-v `pwd`/data:/var/lib/registry \
registry:2
container-ship
Manual raise master daemon mkdir $(pwd)/assets && \
docker run -d --name container-ship \
-v $(pwd)/assets:/assets \
-p 127.0.0.1:8443:8443 \
-e ENDPOINT=127.0.0.1:8443 \
--restart always \
--log-driver json-file \
--log-opt max-size=5m \
oxmix/container-ship
Logs alert to telegram
- golang by matching:
fatal error:
|panic:
- php by matching:
PHP Parse error
|PHP Fatal error
|PHP Warning
|PHP Notice
- node by matching:
Error:
|EvalError:
|RangeError:
|ReferenceError:
|SyntaxError:
|TypeError:
|URIError:
docker run ... \
...
-e NOTIFY_MATCH='fatal error:|panic:|my custom warning' \
-e NOTIFY_TG_TOKEN=... \
-e NOTIFY_TG_CHAT_ID=... \
...
oxmix/container-ship
Deployment through file
curl -kX POST https://127.0.0.1:8443/deployment --data-binary "@test-deployment.yaml"
Nodes
Tab - Shows stats by nodes
Hub
Example - Shows own docker registry
Logs
Example - Showing logs realtime from container with support json pretty