Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kubegu committed Oct 13, 2022
1 parent 329c061 commit 5b0537e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Stage Build
FROM golang:1.19 as build

ENV GOOS=linux
ENV GOARCH=amd64
ENV CGO_ENABLED=0

WORKDIR /app

COPY go.mod go.sum ./
COPY cmd/server/main.go ./
COPY pkg ./pkg
RUN go mod download
RUN go build -o lib-api

# Stage Run
FROM alpine:latest
WORKDIR /app
COPY --from=build /app/lib-api .
RUN chmod +x lib-api
CMD ["./lib-api"]
EXPOSE 8080
Empty file removed example/example_result.html
Empty file.
2 changes: 0 additions & 2 deletions pkg/api/handler.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package api

import (
"fmt"
"net/http"
"net/url"

Expand All @@ -21,7 +20,6 @@ func RegisterRoutes(router *gin.Engine) {
c.AbortWithError(http.StatusBadRequest, err)
return
}
fmt.Println(params)
platform, encErr := url.QueryUnescape(params.Platform)
if encErr != nil {
c.AbortWithError(http.StatusBadRequest, encErr)
Expand Down

0 comments on commit 5b0537e

Please sign in to comment.