-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (24 loc) · 691 Bytes
/
Dockerfile
File metadata and controls
40 lines (24 loc) · 691 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
34
35
36
37
38
39
40
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.26-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -ldflags="-s -w" -o /app/app .
FROM alpine:3.22
RUN apk --no-cache add ca-certificates
ARG IMAGE_TAG
ENV IMAGE_TAG=$IMAGE_TAG
LABEL org.opencontainers.image.version=$IMAGE_TAG
ENV DEFAULTS_PATH=/app/data/defaults.yml
ENV FAVICON_PATH=/app/data/favicon.ico
ENV CONFIG_PATH=/config/config.yml
ENV TOKENS_DIR=/config/tokens
ENV DB_PATH=/db/db.sqlite
ENV REDACT_TOKENS=true
WORKDIR /app
COPY --from=builder /app/app .
COPY data/ /app/data/
CMD ["./app"]