CCash/docs/deploy.md
2021-06-23 19:01:42 +01:00

2.4 KiB

Deploying CCash

CCash can deployed to a remote machine pretty simply.

A pre-built docker image is supplied in the repos GitHub Packages container registry EntireTwix/CCash.

It can be run with docker like so:

docker pull docker.pkg.github.com/entiretwix/ccash/ccash:latest

Build

The CCash repo provides a GitHub Workflow to build, release and publish the docker image in .github/workflows/build.yaml to the GitHub Packages container registry.

You can build and publish your own images using this workflow by forking EntireTwix/CCash.

Deploy

You can deploy this docker image to be run on a remote machine in a few steps. In this case we are using Debian OS running on the Linode cloud provider, but most OS and cloud providers will work, assuming the machine can run an SSH server and Docker.

Similarly, the CCash repo also provides a GitHub Workflow to deploy the latest docker image to a remote machine in .github/workflows/deploy.yaml.

Configure the machine

  • Create a machine using your chosen cloud provider.
  • Configure DNS to point your chosen domain name to the machines IP address. (Without this, TLS/SSL will not work).
  • Create an SSH key-pair by running ssh-keygen locally. Make sure you don't set a password.
  • Add the *.pub public key to the servers ~/.ssh/authorized_keys file.
  • Install Docker Engine following official docs.
  • Add the private key (not *.pub) to a GitHub secret named CCASH_SSH_KEY in your CCash repo.
  • Add the domain name pointing to the remote machine to a GitHub secret named CCASH_DOMAIN.

You are now ready to run the "Deploy" workflow mentioned above. This workflow will SSH in to the CCASH_DOMAIN machine, using the CCASH_SSH_KEY and docker run the latest entiretwix/ccash image, binding to port 80 and 443. It will also handle the creation of a TLS/SSL certificate for you.

Visiting https://$SSH_TARGET/BankF/ping in your browser should verify that it has been deployed correctly.