-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 1004 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (24 loc) · 1004 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
# syntax=docker/dockerfile:1
FROM golang:1.24 AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG VG_TAG=dev
ARG VG_COMMIT=unknown
ARG VG_BUILD_DATE=unknown
ARG VG_BUILD_TAGS=
RUN set -eu; \
tags=""; \
if [ -n "${VG_BUILD_TAGS}" ]; then tags="-tags ${VG_BUILD_TAGS}"; fi; \
ldflags="-s -w -X github.com/inkdust2021/vibeguard/internal/version.Version=${VG_TAG} -X github.com/inkdust2021/vibeguard/internal/version.GitCommit=${VG_COMMIT} -X github.com/inkdust2021/vibeguard/internal/version.BuildDate=${VG_BUILD_DATE}"; \
CGO_ENABLED=0 go build -trimpath -buildvcs=false ${tags} -ldflags "${ldflags}" -o /out/vibeguard ./cmd/vibeguard
FROM alpine:3.20
RUN apk add --no-cache ca-certificates && update-ca-certificates
WORKDIR /root
ENV HOME=/root
COPY --from=builder /out/vibeguard /usr/local/bin/vibeguard
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
EXPOSE 28657
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["start", "--foreground"]