mirror of
https://github.com/pischule/go-mention-all-bot.git
synced 2025-12-19 06:56:43 +00:00
refactor dockerfile
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -1,11 +1,22 @@
|
|||||||
FROM golang:1.18-alpine as builder
|
FROM golang:1.18-alpine as builder
|
||||||
|
|
||||||
RUN apk add --no-cache gcc musl-dev
|
RUN apk add --no-cache gcc musl-dev
|
||||||
WORKDIR /build
|
|
||||||
COPY . .
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ["go.mod", "go.sum", "./"]
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY *.go ./
|
||||||
|
|
||||||
RUN go build -a -o bot
|
RUN go build -a -o bot
|
||||||
|
|
||||||
FROM alpine:3.16
|
FROM alpine:3.16
|
||||||
COPY --from=builder /build/bot /app/bot
|
|
||||||
|
COPY --from=builder /app/bot /app/bot
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN mkdir data
|
RUN mkdir data
|
||||||
|
|
||||||
ENTRYPOINT ["./bot"]
|
ENTRYPOINT ["./bot"]
|
||||||
Reference in New Issue
Block a user