# Portinus
Portinus is a tool that creates a systemd service out of a docker-compose.yml file.
## Why Portinus? Why not use docker application bundles/swarm/deploy?
Docker Application Bundles deployed via swarm are great, but in order to support horizontal scaling for many of the features in docker, you lose much of the composability and many features, such as network_modes and some other more complex interdependencies.
## Features
* Automatic timer-based stack restart
* Automatic health-check-based stack restart (just define a health check in your compose file and it works like magic!)
## Installation
`pip3 install portinus`
## Usage
*NOTE*: For all possible options, please use `portinus --help` and `portinus <command> --help` for more information.
### Requirements:
* docker
* docker-compose
* systemd
* python3
### To create or update a service:
```
sudo portinus ensure --name foo --source /home/justin/foo --env /home/justin/environment-file --restart daily
```
* Where `/home/justin/foo` is a directory containing a `docker-compose.yml` file.
* Where `/home/justin/environment-file` is a systemd EnvironmentFile formated list of key-pairs. These values can be used in the docker-compose.yml file
* This will create a service named `portinus-foo` that will be enabled on boot and started as soon as it is created.
* The files it runs will only be a snapshot of the source folder at the time portinus is executed.
* Any files generated using paths such as `./` in the `docker-compose.yml` file will be removed during installation. All 'updates' are clean installs.
* `--restart` supports any systemd `OnCalendar` format schedules such as 'daily', 'weekly', etc
### To use docker-compose on a service:
```
portinus compose foo ps
```
```
portinus compose foo logs bar
```
### To disable a service on boot
Just treat it like any other systemd service:
```
sudo systemctl disable portinus-foo.service
```
### To remove a service
```
sudo portinus remove foo
```
### To stop or restart a service
```
sudo portinus stop foo
sudo portinus restart foo
```
* Only the name is required to remove a service
* The service will be disabled and removed from systemd
* The environment file and installed copy of the service will all be removed
PyPI 官网下载 | portinus-1.0.16.tar.gz
版权申诉
56 浏览量
2022-01-29
05:02:22
上传
评论
收藏 7KB GZ 举报
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 智能卡管理工具 - 野火2019专业版软件
- Android平台上的百度地图定位演示案例
- 全国 31省市场分割指数2004-2022年
- 华夏ERP基于SpringBoot框架和SaaS模式立志为中小企业提供开源好用的ERP软件
- Android光学字符识别(OCR)工具或库
- 基于C语言+STM32实现的智能自平衡小车+源码解析+超声波避障+超声波跟随+蓝牙遥控等功能+硬件资料+仿真(高分优秀项目)
- C# 屏幕录制 AForge.NET Framework-2.2.5
- 全国31省-环境污染综合指数(2008-2022年).zip
- 校园小情书微信小程序源码 - 社区小程序前后端开源 - 校园表白墙交友小程序
- 基于java的进销存管理系统软件源码+课设文档资料.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)