-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
20 lines (17 loc) · 876 Bytes
/
Dockerfile
File metadata and controls
20 lines (17 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM golang:1.24-alpine AS builder
WORKDIR /go/src/github.com/superfly/tokenizer
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
go mod download
COPY VERSION ./
COPY *.go ./
COPY ./macaroon ./macaroon
COPY ./cmd/tokenizer ./cmd/tokenizer
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
go build -ldflags "-X 'main.Version=$(cat VERSION)' -X 'main.FilteredHeaders=Fly-Client-Ip,Fly-Forwarded-Port,Fly-Forwarded-Proto,Fly-Forwarded-Ssl,Fly-Region,Fly-Request-Id,Fly-Traceparent,Fly-Tracestate,Fly-Src,Fly-Src-Signature'" -buildvcs=false -o ./bin/tokenizer ./cmd/tokenizer
FROM alpine:latest AS runner
WORKDIR /root
COPY --from=builder /go/src/github.com/superfly/tokenizer/bin/tokenizer /usr/local/bin/tokenizer
CMD ["tokenizer", "serve", "-use-flysrc=true"]