forked from czarcas7ic/cosmprund
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 777 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# ----------------------------------------------------------------
# Builder Stage
# ----------------------------------------------------------------
ARG GO_VERSION="1.21"
FROM golang:${GO_VERSION}-alpine AS builder
# Download go dependencies
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
# Copy the remaining files
COPY cmd /app/cmd
COPY internal /app/internal
COPY *.go /app/
# Build binary
RUN go build \
-mod=readonly \
-ldflags "-w -s" \
-trimpath \
-o /app/build/cosmprund
# ----------------------------------------------------------------
# Final image for Running
# ----------------------------------------------------------------
FROM alpine:3.19
COPY --from=builder /app/build/cosmprund /usr/bin/cosmprund
ENTRYPOINT [ "/usr/bin/cosmprund" ]