File tree Expand file tree Collapse file tree
java/io/swagger/codegen/v3/generators/go
resources/handlebars/go-server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public void processOpts() {
9898 * it will be processed by the template engine. Otherwise, it will be copied
9999 */
100100 supportingFiles .add (new SupportingFile ("swagger.mustache" , "api" , "swagger.yaml" ));
101+ supportingFiles .add (new SupportingFile ("Dockerfile" , "" , "Dockerfile" ));
101102 supportingFiles .add (new SupportingFile ("main.mustache" , "" , "main.go" ));
102103 supportingFiles .add (new SupportingFile ("routers.mustache" , apiPath , "routers.go" ));
103104 supportingFiles .add (new SupportingFile ("logger.mustache" , apiPath , "logger.go" ));
Original file line number Diff line number Diff line change 1+ FROM golang:1.10 AS build
2+ WORKDIR /go/src
3+ COPY go ./go
4+ COPY main.go .
5+
6+ ENV CGO_ENABLED=0
7+ RUN go get -d -v ./...
8+
9+ RUN go build -a -installsuffix cgo -o swagger .
10+
11+ FROM scratch AS runtime
12+ COPY --from=build /go/src/swagger ./
13+ EXPOSE 8080/tcp
14+ ENTRYPOINT ["./swagger" ]
You can’t perform that action at this time.
0 commit comments