You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
623 B

# GO Repo base repo
FROM golang:alpine3.14 as builder
RUN apk add git
# Add Maintainer Info
LABEL maintainer="<Philipp Böhm>"
RUN mkdir /app
ADD . /app
COPY go.mod go.sum ./
# Download all the dependencies
RUN go mod download
COPY . .
# Build the Go app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main ./cmd/main.go
# GO Repo base repo
FROM alpine:latest
RUN apk --no-cache add ca-certificates curl
RUN mkdir /app
# Copy the Pre-built binary file from the previous stage
COPY --from=builder /app .
# Expose port 3000
# Run Executable
CMD ["./main"]