# Postal
A light Docker control tool designed around compose and swarm
[Documentation](https://github.com/obe-de/postal)
[PyPi Package](https://pypi.org/project/docker-postal/)
# Getting Started
Postal requires that you have python >= 3.6, docker, and docker-compose installed. Postal is designed for use on Linux.
# Installing Client
To install:
`pip install docker-postal`
For the console script to be installed you may need to install with:
`pip install --user docker-postal`
Or unfortunately if (~/.local/bin) is not on your system path:
`sudo pip install docker-postal`
# Installing Service
To install the postal server, you must first setup a secure S3 bucket to store configurations.
### S3 Bucket
To setup S3, create a secure, private, encrypted bucket. Then create user to access this bucket with the following
permissions:
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObjectAcl",
"s3:GetObject",
"s3:ListBucket",
"s3:DeleteObject",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::example-bucket-name/*",
"arn:aws:s3:::example-bucket-name"
]
}
]
}
```
### Postal Service
The postal service runs an openssh server than enables remote access to the docker daemon/swarm.
On swarm manager, login to a docker repository where images will be pushed and retrieved:
```
docker login
```
Create postal config folder and add an authorized key:
```
mkdir /data/postal
touch /data/postal/authorized_keys
chmod 600 /data/postal/authorized_keys
sudo chown -R root:root /data/postal
sudo nano /data/postal/authorized_keys # paste in your public key and save
```
Clone postal repository:
```
git clone https://github.com/obe-de/postal
cd postal
```
Create an environment file:
```
nano stack/production.env
```
Then paste:
```
POSTAL_AWS_BUCKET=example-bucket-name
POSTAL_AWS_REGION=us-east-2
AWS_ACCESS_KEY_ID=YOURKEY
AWS_SECRET_ACCESS_KEY=yoursecret
```
Deploy postal stack:
```
docker stack rm postal # (optional)
docker build -t postal:latest -f stack/postal/Dockerfile .
docker stack deploy -c stack/production.yml postal
```
Check that everything is working:
```
docker service ls | grep postal
```
(Optional) Check that you can exec bash in the container:
```
docker exec -it $(docker ps -aqf "name=postal_postal") bash
```
Login from the client:
```
postal login -u root -a yourdomain -p 5020
```
# Connecting and Deploying
After you have deployed the postal service check that your public key has been added (instructions below) so
you have permission to connect.
1. Login to the postal service using `postal login`.
2. Double check that you have connected by running a swarm command like `postal swarm ps`.
3. Enter project directory that you want to deploy.
4. Configure project environment variables: `postal config ls` and `postal config set` etc.
5. Create a `production.yml` file in the stack with `env_file: production.env` if you want the
project's production configuration injected.
6. Make sure the ports you have selected in `production.yml` aren't going to clash with an
existing service.
7. Deploy working directory using `postal swarm deploy -w`.
8. Check the status of your service using `postal swarm service ls`
9. Debug services that fail to replicate using `docker service ps --no-trunc your_service_name_here`
10. Your service should be accessible via any node on the swarm if you used the swarms overlay network.
# Todo
* Don't use disk backed temp files for RPC input / output
* Deploy from git origin
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共24个文件
py:20个
toml:1个
license:1个
资源分类:Python库 所属语言:Python 资源全名:docker-postal-0.0.13.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
docker-postal-0.0.13.tar.gz (24个子文件)
docker-postal-0.0.13
PKG-INFO 4KB
pyproject.toml 732B
postal
core
db.py 587B
utils.py 638B
rpc.py 3KB
__init__.py 0B
swarm.py 795B
settings.py 514B
config.py 897B
commands
enter.py 827B
deploy.py 876B
launch.py 564B
call.py 393B
__init__.py 380B
swarm.py 180B
compose.py 282B
config.py 1KB
login.py 1KB
version.py 263B
cli.py 2KB
__init__.py 0B
LICENSE 1KB
setup.py 5KB
README.md 4KB
共 24 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于ASMSEdit的输入数据校验
- MySql5.7版本连接Unity需要的mysql.data.dll文件
- 基于Objective-C实现手机共享单车信息管理系统设计与实现
- Firewalls Don't Stop Dragons, 3rd Edition
- rk3588rk3588s使用c++多线程异步等优化c++实现源码(yolov5运行可达到142fps)+项目使用说明.zip
- Jenkins Continuous Integration Cookbook, Second Edition
- 首涂第二十八套-新版海螺M3多功能苹果CMSv10自适应全屏高端模板 (1).zip
- 游戏开发+JavaScript+贪吃蛇+源码
- Extending Jenkins
- yolov5+Deepsort部署于rk3588和rk3399pro开发板C++完整源码(车辆行人跟踪)+模型+部署文档.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功