diff --git a/Dockerfile b/Dockerfile index 1f3b217..8305e55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,4 +29,4 @@ ENV GENESIS_BUILD_COMMIT=${GENESIS_BUILD_COMMIT} HEALTHCHECK CMD wget --no-verbose --tries=1 --spider http://localhost:${GENESIS_PORT}/health || exit 1 -CMD ["./genesis start"] +ENTRYPOINT ["./genesis"] diff --git a/README.md b/README.md index 0041fcf..efab623 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ First, create a [.env](.env.example) and specify the initial usernames and passw Make sure to fill out `GENESIS_JWT_SECRET` with a secure, random string, for that you can use `openssl rand -hex 32`. You can specify the remaining values, but the defaults are good for medium-sized projects such as [ocular](https://github.com/Simonwep/ocular). -Second, start the server via `go run .`. That's it. +Second, start the server via `go run . start` - That's it. Head to the [api](#api) documentation to see how to use it. +Use `go run . help` to see all available commands. The `json` is pre-processed by the [minify](https://github.com/tdewolff/minify) package to minimize and validate it. @@ -36,11 +37,17 @@ The `json` is pre-processed by the [minify](https://github.com/tdewolff/minify) You can run genesis using [docker](https://www.docker.com/products/docker-desktop/) by using pre-build images: ```sh -docker run -p 8080:8080 -v "$(pwd)/.data:/app/.data" --env-file .env ghcr.io/simonwep/genesis:latest +docker run -p 8080:8080 -v "$(pwd)/.data:/app/.data" --env-file .env ghcr.io/simonwep/genesis:latest start ``` Genesis should then be accessible under port `8080`. +You can access the api by changing the `start` command, for example - to list all users: + +```sh +docker run --rm -v "$(pwd)/.data:/app/.data" --env-file .env ghcr.io/simonwep/genesis:latest users list +``` + > [!NOTE] > You can specify the base-url via the env variable `GENESIS_BASE_URL`. diff --git a/main.go b/main.go index 64af907..127e50b 100644 --- a/main.go +++ b/main.go @@ -18,11 +18,11 @@ func main() { Commands: []*cli.Command{ { Name: "start", - Usage: "Start the api", + Usage: "Start the server", Action: commands.Start, }, { - Name: "user", + Name: "users", Usage: "Manage users", Subcommands: []*cli.Command{ {