forked from andychase/gbajs2
-
Notifications
You must be signed in to change notification settings - Fork 36
Self Hosting
Nicholas VanCise edited this page Nov 17, 2024
·
20 revisions
- for a quick local development setup, follow the commands in this README section
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.
- Clone this repo to your deployment server
- ensure port
80
/443
are exposed to the internet
- ensure port
- SSL is currently required
- I recommend using
LetsEncrypt
withcertbot
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)
- I recommend using
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, sayn
toDo 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
- if using a registry, you will need to create a file
- 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, sayn
toDo 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
- you can add and remove services from the
- Once your env variables are set to your liking, you can build the images and run the services using:
docker compose up --build