Skip to content

Commit

Permalink
feat: make docker compatible with new cli and update docs for it
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwep committed Sep 18, 2024
1 parent 0032c02 commit 924619f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 -p 8080:8080 -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`.
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand Down

0 comments on commit 924619f

Please sign in to comment.