This is intended to be run as an init container. It will make HTTP requests to a configured URL to determine if the service is functional.
As this is intended to be a docker entrypoint the preferred way to install is using with a dockerfile.
COPY --from=ghcr.io/quantcdn/backend-init:latest /usr/local/bin/backend-init /usr/local/bin/backend-init
This can be run directly from the docker image:
docker run --rm ghcr.io/quantcdn/backend-init:latest --help
$ backend-init --help
usage: backend-init [<flags>]
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
--url=URL The backend url.
--retry=10 Times to retry the backend connection.
--delay=5 Delay between backend requests.
--version Show application version.
For example to execute build
and start
after a backend connection has been established.
backend-init --url http://localhost build start
git clone [email protected]:quantcdn/backend-init.git && cd backend-init
go generate ./...
go build -ldflags="-s -w" -o build/backend-init .
go run . -h
go test -v ./... -coverprofile=build/coverage.out
View coverage results:
go tool cover -html=build/coverage.out
cd docs
npm install
npm run dev