Package: docker-postal
PostalA light Docker control tool designed around compose and swarmDocumentationPyPi PackageGetting StartedPostal requires that you have python >= 3.6, docker, and docker-compose installed. Postal is designed for use on Linux.Installing ClientTo install:pip install docker-postalFor the console script to be installed you may need to install with:pip install --user docker-postalOr unfortunately if (~/.local/bin) is not on your system path:sudo pip install docker-postalInstalling ServiceTo install the postal server, you must first setup a secure S3 bucket to store configurations.S3 BucketTo 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 ServiceThe 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 loginCreate 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 saveClone postal repository:git clone https://github.com/obe-de/postal
cd postalCreate an environment file:nano stack/production.envThen paste:POSTAL_AWS_BUCKET=example-bucket-name
POSTAL_AWS_REGION=us-east-2
AWS_ACCESS_KEY_ID=YOURKEY
AWS_SECRET_ACCESS_KEY=yoursecretDeploy postal stack:docker stack rm postal # (optional)
docker build -t postal:latest -f stack/postal/Dockerfile .
docker stack deploy -c stack/production.yml postalCheck 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") bashLogin from the client:postal login -u root -a yourdomain -p 5020Connecting and DeployingAfter you have deployed the postal service check that your public key has been added (instructions below) so
you have permission to connect.Login to the postal service usingpostal login.Double check that you have connected by running a swarm command likepostal swarm ps.Enter project directory that you want to deploy.Configure project environment variables:postal config lsandpostal config setetc.Create aproduction.ymlfile in the stack withenv_file: production.envif you want the
project's production configuration injected.Make sure the ports you have selected inproduction.ymlaren't going to clash with an
existing service.Deploy working directory usingpostal swarm deploy -w.Check the status of your service usingpostal swarm service lsDebug services that fail to replicate usingdocker service ps --no-trunc your_service_name_hereYour service should be accessible via any node on the swarm if you used the swarms overlay network.TodoDon't use disk backed temp files for RPC input / outputDeploy from git origin