Docker Compose files to spin up an instance of signal-cli-rest-api.
# How to run
We depend on the project's upstream GitHub repo at [github.com/bbernhard/signal-cli-rest-api](https://github.com/bbernhard/signal-cli-rest-api) which comes with a [docker-compose.yml](https://github.com/bbernhard/signal-cli-rest-api/blob/master/docker-compose.yml) file that we're using as our base file in `docker compose` commands.
Add a `COMPOSE_ENV` file and save its location as a shell variable along with the location where this repo lives, here for example `/opt/containers/signal_cli_rest_api` plus all other variables. At [env/fqdn_context.env.example](env/fqdn_context.env.example) you'll find an example environment file.
When everything's ready start signal-cli-rest-api with Docker Compose, otherwise head down to [Initial setup](#initial-setup) first.
## Environment
We're assuming that the `master` branch of [github.com/bbernhard/signal-cli-rest-api](https://github.com/bbernhard/signal-cli-rest-api) is checked out at `/opt/git/github.com/bbernhard/signal-cli-rest-api/tags/latest`. We'll get to the `tags/latest` nomenclature in sec.
Check out the newest branch of [github.com/bbernhard/signal-cli-rest-api](https://github.com/bbernhard/signal-cli-rest-api). Notice that we're referencing `"${UPSTREAM_REPO_DIR}"` from above and that we're storing the current Git `refname` of our branch in `"${VERSION}"`. This is typically a string such as `0.91` and happens to coincide with Docker image tags used at [Docker Hub at bbernhard/signal-cli-rest-api](https://hub.docker.com/r/bbernhard/signal-cli-rest-api).
```
git -C "${UPSTREAM_REPO_DIR}" reset --hard origin
git -C "${UPSTREAM_REPO_DIR}" checkout master
git -C "${UPSTREAM_REPO_DIR}" pull
export VERSION="$(git -C "${UPSTREAM_REPO_DIR}" tag -l --sort -version:refname | head -n 1)"
On your deployment machine create the necessary Docker context to connect to and control the Docker daemon on whatever target host you'll be using, for example:
Copy images to target Docker host, that is assuming you deploy to a machine that itself has no network route to reach Docker Hub or your private registry of choice. Copying in its simplest form involves a local `docker save` and a remote `docker load`. Consider the helper mini-project [quico.space/Quico/copy-docker](https://quico.space/Quico/copy-docker) where [copy-docker.sh](https://quico.space/Quico/copy-docker/src/branch/main/copy-docker.sh) allows the following workflow. Note that `"${VERSION}"` comes from the Git `refname` we used a second ago.
We're assuming you run Docker Compose workloads with ZFS-based bind mounts. ZFS management, creating a zpool and setting adequate properties for its datasets is out of scope of this document.
## Datasets
Create ZFS datasets and set permissions as needed.