Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add health check info on readme #22

Merged
merged 1 commit into from Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
@@ -1,4 +1,4 @@
name: Release
name: release

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
@@ -1,4 +1,4 @@
name: Verify
name: verify

on:
push:
Expand Down
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -231,8 +231,27 @@ curl --location --request GET 'http://localhost:8000/v1/delivery-attempts/d72719
}
```

### Health check

The health check server is running on port defined by envvar POSTMAND_HEALTH_CHECK_HTTP_PORT (defaults to 8001).

```bash
curl --location --request GET 'http://localhost:8001/healthz'
```

```javascript
{
"success":true
}
```

### Environment variables

All environment variables is defined on file local.env.

## How to build docker image

```
docker build -f Dockerfile -t postmand .
```

14 changes: 7 additions & 7 deletions local.env
@@ -1,7 +1,7 @@
POSTMAND_DATABASE_URL='postgres://user:pass@localhost:5432/postmand?sslmode=disable'
# See https://github.com/golang-migrate/migrate/tree/master/source/file
POSTMAND_DATABASE_MIGRATION_DIR='file://db/migrations'
POSTMAND_DATABASE_MAX_OPEN_CONNS='2'
POSTMAND_POLLING_INTERVAL='1000'
POSTMAND_HTTP_PORT='8000'
POSTMAND_HEALTH_CHECK_HTTP_PORT='8001'
POSTMAND_DATABASE_URL='postgres://user:pass@localhost:5432/postmand?sslmode=disable' # main database
POSTMAND_TEST_DATABASE_URL='postgres://user:pass@localhost:5432/postmand_test?sslmode=disable' # test database
POSTMAND_DATABASE_MIGRATION_DIR='file://db/migrations' # See https://github.com/golang-migrate/migrate/tree/master/source/file
POSTMAND_DATABASE_MAX_OPEN_CONNS='2' # sets the maximum number of open connections to the database
POSTMAND_POLLING_INTERVAL='1000' # worker database polling interval (in miliseconds)
POSTMAND_HTTP_PORT='8000' # port for the api server
POSTMAND_HEALTH_CHECK_HTTP_PORT='8001' # port for health check server