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

docs: Add example how to run using docker #46

Merged
merged 2 commits into from
Sep 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ v0.18.0.
- [Usage](#usage)
- [Cheatsheet](#cheatsheet)
- [Run](#run)
- [Docker](#docker)
- [Source](#source)
- [TODO](#todo)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -166,6 +168,31 @@ available networks, then you'll have to restart docker service or reboot.

## Run

### Docker

```
$ docker run -i -t --rm ghcr.io/powerman/go-service-example -v
address-book version 0894daa 2020-09-13_19:44:26 go1.15.2
$ docker run -i -t --rm \
-p 8000:8000 \
-e EXAMPLE_APIKEY_ADMIN=secret \
ghcr.io/powerman/go-service-example
address-book: inf main: `started` version 0894daa 2020-09-13_19:44:26
address-book: inf openapi: `OpenAPI protocol` version 0.2.0
address-book: inf serve: `serve` b3ecd12369c3:9000 [Prometheus metrics]
address-book: inf serve: `serve` 172.19.0.6:8000 [OpenAPI]
address-book: inf swagger: `Serving address book at http://172.19.0.6:8000`
^C
address-book: inf swagger: `Shutting down... `
address-book: inf swagger: `HTTP server Shutdown: context deadline exceeded`
address-book: inf swagger: `Stopped serving address book at http://172.19.0.6:8000`
address-book: inf serve: `shutdown` [OpenAPI]
address-book: inf serve: `shutdown` [Prometheus metrics]
address-book: inf main: `finished` version 0894daa 2020-09-13_19:44:26
```

### Source

Use of the `./scripts/build` script is optional (it's main feature is
embedding git version into compiled binary), you can use usual
`go get|install|build` to get the application instead.
Expand Down