Deploy Helium Budget Proposals backend, frontend and everything else that goes along with it.
There are 3 Helium specific things this procedure will download:
- Backend: https://github.com/KristerV/heliumpay-budgetweb-backend
- Frontend: https://github.com/KristerV/heliumpay-budgetweb-frontend
- Daemon: https://github.com/gjhiggins/dash/archive/helium.zip
These are hardcoded since the docker build
process heavily depends on what it downloads.
Install prerequisites
Arch Linux yaourt -S docker docker-compose docker-machine && systemctl start docker
Tell DM where to find CoreOS in the first place
I have no idea.. Fill when you find out.
Connect docker-machine to CoreOS server
eval $(docker-machine env helium-core-1)
Get environment secrets
Make a file called .env.production.secrets
(or whatever) and insert env variables like so:
export DB_HOST=xxx
export DB_PORT=xxx
export MAILGUN_API_KEY=xxx
export MAILGUN_DOMAIN=xxx
This is not the full list of variables needed. Later when we're using Docker Swarm, we can use docker secret
for this.
Build and Deploy
(source .env.production.secrets && docker-compose up -d)
Enable SSL
Haven't figured this part out properly so you'll have to enable SSL manually.
- SSH into the container with
docker-compose exec nginx /bin/bash
- Run certbot
certbot --nginx
- Answer all questions wisely.
Update container
docker-compose build --no-cache backend
Connect to server
eval $(docker-machine env helium-core-1)
Deploy
docker-compose up -d
Sorry, this is still manual.
- SSH into the container with
docker-compose exec nginx /bin/bash
- Run certbot
certbot renew
List running containers: docker ps
List available containers: docker container ls
List available images: docker image ls
Stop all containers: docker-compose down
See logs for container: docker-compose logs backend
Rebuild only changed layers (and deploy): docker-compose up -d --build