Skip to content

Self Hosting

Nicholas VanCise edited this page Nov 17, 2024 · 20 revisions

Quick Setup

  • for a quick local development setup, follow the commands in this README section

In depth hosting guide

To build and deploy the app ready for production use, the process is similar to the quick setup, but with some slight modifications.

Supported deployment methods at this time out of the box are:

  • docker swarm
  • docker compose

Future work is being done to deploy on kubernetes platforms such as k3s.

Setup

  • Clone this repo to your deployment server
    • ensure port 80/443 are exposed to the internet
  • SSL is currently required
    • I recommend using LetsEncrypt with certbot to generate certificates
    • Don't forget to set the CERT_LOC/KEY_LOC env variables to the certificate paths in the respective env file(s)

Run with Docker Swarm

The swarm installation is designed to work with a docker registry, preferring a private registry through ghcr out of the box.

  • Run the./bin/boostrap.sh; script and follow the interactive prompts, say n to Do you want to generate certificates at <CERT_DIR>
  • Modify the generated .env.swarm file to suit your local environment, services, local file mounts, and url locations
  • Once your env variables are set to your liking, you can pull images from your registry and run the services using:
    • source ./.env.swarm
    • docker stack deploy --with-registry-auth -c docker-compose.swarm.yaml -c ./auth/docker-compose.yaml -c ./admin/docker-compose.yaml -c ./postgres/docker-compose.yaml -c ./gbajs3/docker-compose.yaml -c ./shepherd/docker-compose.yaml gbajs3
    • you can add and remove services from the stack command above in the case that you are connecting to external services that are already running
    • once complete, shepherd will attempt to auto deploy images when a new version of the latest tag is pushed to the registry specified in the .env.swarm file
      • if using a registry, you will need to create a file ./shepherd/shepherd-registries containing registry locations and credentials

Build and run with Docker Compose

  • You may shortcut the build steps if you build and push/pull images from a registry
  • Run the./bin/boostrap.sh; script and follow the interactive prompts, say n to Do you want to generate certificates at <CERT_DIR>
  • Modify the generated .env file to suit your local environment, services, local file mounts, and url locations
    • you can add and remove services from the COMPOSE_FILE env variable in the case that you are connecting to external services that are already running
  • Once your env variables are set to your liking, you can build the images and run the services using:
    • docker compose up --build
Clone this wiki locally