diff --git a/Dockerfile b/Dockerfile index 470204b..8530ab9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ -FROM golang:1.20.4-alpine3.18 +ARG VERSION +FROM golang:1.20.4-alpine3.18 ARG VERSION ENV VERSION=$VERSION - COPY . /go/src/go-mtg-vk WORKDIR /go/src/go-mtg-vk RUN go build ./cmd/$VERSION -RUN mkdir logs + +FROM alpine:3.18 +RUN mkdir /app +WORKDIR /app +ARG VERSION +ENV VERSION=$VERSION +COPY --from=0 /go/src/go-mtg-vk/$VERSION . ENV GIN_MODE=release -ENTRYPOINT ./$VERSION +ENTRYPOINT ./$VERSION \ No newline at end of file diff --git a/internal/vk/handler.go b/internal/vk/handler.go index 77eae6b..c0bf83a 100644 --- a/internal/vk/handler.go +++ b/internal/vk/handler.go @@ -55,7 +55,7 @@ func (h *Handler) HandleMessage(c *gin.Context) { case "confirmation": h.handleConfirmation(c, &req) case "message_new": - go h.Scenario.HandleSearch(context.Background(), &scenario.UserMessage{ + h.Scenario.HandleSearch(context.Background(), &scenario.UserMessage{ Body: req.Object.Body, UserId: req.Object.UserId, })