Script and configuration for standing up a Docker host. This includes Docker, multiple configured stacks, and a self-hosted GitHub Actions Runner.
Right now, installation supports Red Hat 9 (which also works with RHEL lookalikes such as Rocky Linux), macOS, and Ubuntu. WSL should be support by virtue of support for Ubuntu. Actual Docker installation is handled by the installation script, but you can use the stacks installer directly on any *nix machine by running stacks/setup.sh.
To begin a standard installation:
bash <(curl -H 'Cache-Control: no-cache, no-store' -o- https://raw.githubusercontent.com/uicpharm/docker-host/main/init.sh)For more documentation about the stacks, please view the stacks readme.
For all environments, a deploy script is installed in the system that helps with
deploying applications that use the docker-host environment. They provide a compose stack
and any additional required files (.env file, etc), and then deploy with this script.
It takes these standard steps for deployment of UIC Pharmacy stacks:
- Login to your Docker repo
- Stop the application if it is currently running
- Create a pod (if using podman)
- Start up the stack using the stack path you provide
- Install the stack as a service (if using podman)
Example:
deploy production.ymlThis will automatically deploy the application and install it as a service named
prior-auth-drug-search-production, if you are running a podman system.
Note if you are using an environment file named something other than .env, you must
pass it to the script as well:
deploy production.yml --env-file=production.envThe deploy script can handle upgrades as well. Just pass the --upgrade flag to ensure
it handles pulling fresh container images:
deploy production.yml --upgradeFor all environments, the publish script helps with building and publishing container
images from your workstation to our container registry. It builds the image using the UIC
Pharmacy standards, such as:
- Uses semantic versioning based on the
versiondefined inpackage.json, including intelligent re-tagging of major versions. For instance, version1.2.3will also tag versions1and1.2, however a prerelease like1.2.3-beta.1will not. - Automatically adds the image to the correct repo as long as its
homepageis set inpackage.json. - Creates a multi-arch manifest, so images are built for Intel and Apple Silicon architectures.
- Automatically finds the context and
package.jsonby assuming they're in the same directory as the Dockerfile.
Since podman and buildah do not support non-native architecture builds (i.e. building for arm64 in an amd64 environment), this script will force building only for your native architecture when it runs in a podman environment.
You can build and publish the image for a project with a single Dockerfile by just referencing the Dockerfile in the command:
# For project 'foo', creates image 'ghcr.io/uicpharm/foo':
publish path/to/DockerfileIf you have a project with multiple Docker files, build them one at a time, assigning an additional name that can be appended to the image.
# For project 'foo', creates image 'ghcr.io/uicpharm/foo/bar':
publish path/to/Dockerfile.bar --name=barIf you want to make sure it's working without actually publishing, here are some things you could do to check it:
--dry-run will show you the commands that will run, without actually running them.
--no-push will build the images but not push them to the registry.
--verbose will show you a summary of all the settings that will be used for the build
and publishing process.
If you've installed the GitHub Runner service and now you want to remove it, you can do so by following these steps:
As root:
cd /home/github/runner
./svc.sh stop
./svc.sh uninstallThen, as the github user:
cd ~/runner
./config.sh remove --token your-token-supplied-by-github