Docker build utility for Huma REST OpenAPI services
128
A Docker build helper for Huma.
Usage requires two files: a .huma.yaml configuration and a Dockerfile. Examples:
service: your-service
command: go test && go install
cli:
name: your-service-cli
command: go build
sdk-languages:
- go
- python
- javascript
Note that CLI support requires a cli folder with a main.go that generates all needed code via go generate.
FROM danielgtaylor/huma-build as build
COPY . .
RUN huma-build
FROM alpine as deploy
WORKDIR /service
COPY --from=build /go/bin/your-service /usr/bin/
COPY --from=build /huma/out/*.zip ./downloads/
ENTRYPOINT ["your-service"]
You can then build and run the service!
# Build it!
$ docker build -t your-service .
# Run it!
$ docker run your-service
Check it out at http://localhost:8888/docs.
Content type
Image
Digest
Size
238.5 MB
Last updated
over 6 years ago
docker pull danielgtaylor/huma-build