Optimize dockerfile
This commit is contained in:
parent
32887ec9b8
commit
68f1750beb
2 changed files with 11 additions and 5 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -1,11 +1,17 @@
|
||||||
FROM golang:1.20.4-alpine3.18
|
ARG VERSION
|
||||||
|
|
||||||
|
FROM golang:1.20.4-alpine3.18
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ENV VERSION=$VERSION
|
ENV VERSION=$VERSION
|
||||||
|
|
||||||
COPY . /go/src/go-mtg-vk
|
COPY . /go/src/go-mtg-vk
|
||||||
WORKDIR /go/src/go-mtg-vk
|
WORKDIR /go/src/go-mtg-vk
|
||||||
RUN go build ./cmd/$VERSION
|
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
|
ENV GIN_MODE=release
|
||||||
ENTRYPOINT ./$VERSION
|
ENTRYPOINT ./$VERSION
|
||||||
|
|
@ -55,7 +55,7 @@ func (h *Handler) HandleMessage(c *gin.Context) {
|
||||||
case "confirmation":
|
case "confirmation":
|
||||||
h.handleConfirmation(c, &req)
|
h.handleConfirmation(c, &req)
|
||||||
case "message_new":
|
case "message_new":
|
||||||
go h.Scenario.HandleSearch(context.Background(), &scenario.UserMessage{
|
h.Scenario.HandleSearch(context.Background(), &scenario.UserMessage{
|
||||||
Body: req.Object.Body,
|
Body: req.Object.Body,
|
||||||
UserId: req.Object.UserId,
|
UserId: req.Object.UserId,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue