A Small flask app to test out CI / CD workflow with CircleCI and Docker / Kubernetes.
Started at the Pydays 19 Workshop - Deploying Python with Docker, CircleCI, and Kubernetes
- Instructions from the workshop
- all is done on local machine
Dockerhub repos generated:
Notes from testing out the deployment on Digital Ocean.
- Create a Droplet: Docker One-Click Droplet.
- Choose the cheapest option available.
- 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
- add previously generated ssh key to circleci: https://circleci.com/docs/2.0/add-ssh-key/