1
1
mirror of https://github.com/cooperspencer/gickup synced 2025-02-22 08:51:08 +01:00
gickup/Dockerfile
2025-01-05 20:50:04 +01:00

28 lines
756 B
Docker

FROM golang:1.23-alpine AS builder
# Install dependencies for copy
RUN apk add -U --no-cache ca-certificates tzdata git
# Use an valid GOPATH and copy the files
WORKDIR /go/src/github.com/cooperspencer/gickup
COPY go.mod .
COPY go.sum .
RUN go mod tidy
COPY . .
# Fetching dependencies and build the app
RUN go get -d -v ./...
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o gickup .
# Use alpine as production environment -> Small builds
FROM alpine:3.20 AS production
RUN apk add -U --no-cache ca-certificates tzdata git git-lfs
RUN git lfs install
WORKDIR /
# Copy the main executable from the builder
COPY --from=builder /go/src/github.com/cooperspencer/gickup/gickup /gickup/gickup
ENTRYPOINT [ "/gickup/gickup" ]
CMD [ "/gickup/conf.yml" ]