mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-25 00:24:58 +01:00
24 lines
461 B
Docker
24 lines
461 B
Docker
FROM golang:1.16-alpine as builder
|
|
|
|
# Move to working directory /build
|
|
WORKDIR /build
|
|
|
|
# Copy and download dependency using go mod
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
RUN go mod download
|
|
|
|
# Copy the code into the container
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN go build -o main
|
|
|
|
# Start a new, final image to reduce size.
|
|
FROM alpine as final
|
|
|
|
# Copy the binaries and entrypoint from the builder image.
|
|
COPY --from=builder /build/main /bin/
|
|
|
|
ENTRYPOINT [ "/bin/main" ]
|