32 lines
799 B
Markdown
32 lines
799 B
Markdown
# api-go
|
|
|
|
Golang API that is the backbone for daily usage, while python works in batches and is heavy in compute while Golang handles concurrent usage cheap
|
|
|
|
## Checks
|
|
|
|
```sh
|
|
make check
|
|
```
|
|
|
|
Runs `go vet ./...`, `go test -count=1 ./...`, and `go build ./...`. The same
|
|
target runs in Gitea Actions on every push and pull request
|
|
(`.gitea/workflows/ci.yml`).
|
|
|
|
## Container
|
|
|
|
The image is a multi-stage build. The runtime is
|
|
`gcr.io/distroless/static-debian12:nonroot` and runs as numeric
|
|
**UID/GID `65532:65532`** (`USER 65532:65532` in the `Dockerfile`).
|
|
|
|
Use the same numbers in Kubernetes:
|
|
|
|
```yaml
|
|
securityContext:
|
|
runAsUser: 65532
|
|
runAsGroup: 65532
|
|
runAsNonRoot: true
|
|
```
|
|
|
|
Do not use named users such as `nonroot` in a `securityContext`: the kubelet
|
|
cannot verify a non-numeric image user.
|