dockerize
This commit is contained in:
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
# Cache dependency
|
||||
FROM golang:1.22-alpine AS go-mod-cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
# BUILD
|
||||
FROM go-mod-cache AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY internal .
|
||||
|
||||
RUN go build . -o ip-info
|
||||
|
||||
# RUN IMAGE
|
||||
FROM alpine
|
||||
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache tzdata
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/ip-info .
|
||||
COPY mmdbmeld.yml .
|
||||
|
||||
CMD ["./ip-info"]
|
||||
Reference in New Issue
Block a user