Skip to content

arechberger/flask-docker-demo

Repository files navigation

flask-docker-demo

A Small flask app to test out CI / CD workflow with CircleCI and Docker / Kubernetes.

PYDAYS WORKSHOP 19

Started at the Pydays 19 Workshop - Deploying Python with Docker, CircleCI, and Kubernetes

Dockerhub repos generated:

Deployment

Notes from testing out the deployment on Digital Ocean.

Docker container only.

Droplet generation

Droplet setup.

  • ssh into the droplet
ssh root@<DROPLET_IP>
  • generate ssh keypair. Will be used to allow access from circle-ci. We choose to create a new ssh keypair, instead of using an existing one (such as the one used to login to the droplet from our local machine).

From: https://circleci.com/docs/2.0/add-ssh-key/

Note: Since CircleCI cannot decrypt SSH keys, every new key must have an empty passphrase. CircleCI also will not accept OpenSSH’s default file format - use ssh-keygen -m pem if you are using OpenSSH to generate your key.

ssh-keygen -b 4096 -t rsa -f ~/.ssh/id_rsa_deployment -C "deployment@circleci"
cat ~/.ssh/id_rsa_deployment.pub >> ~/.ssh/authorized_keys

add the deploy_app.sh script to the droplet and make it executable.

wget https://raw.githubusercontent.com/arechberger/flask-docker-demo/master/deploy_app.sh -O ~/deploy_app.sh
chmod +x ~/deploy_app.sh

Configure CircleCi

About

Pydays 19 Workshop - Deploying Python with Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published