-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
83 lines (54 loc) · 1.53 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM golang:1.21-alpine as builder
ARG CGO_ENABLED=0
ARG GOOS=linux
ARG GOARCH=amd64
WORKDIR /app
ENV CGO_ENABLED=${CGO_ENABLED}
ENV GOOS=${GOOS}
ENV GOARCH=${GOARCH}
ENV GOCACHE=/go/cache
VOLUME /go/cache
COPY go.mod ./
RUN go mod download
COPY . .
RUN go build -o dist/bin/keyquarry-linux-amd64
FROM scratch AS base
ARG CGO_ENABLED
ARG GOOS
ARG GOARCH
ENV CGO_ENABLED=${CGO_ENABLED}
ENV GOOS=${GOOS}
ENV GOARCH=${GOARCH}
ENV GOBIN=/go/bin
ENV PATH=${GOBIN}:${PATH}
COPY --from=builder /app/dist/bin/keyquarry-linux-amd64 /go/bin/keyquarry
ENTRYPOINT ["keyquarry"]
FROM base AS server
ENV GOBIN=/go/bin
ENV PATH=${GOBIN}:${PATH}
ENV KEYQUARRY_LISTEN_ADDRESS=":33969"
ENV KEYQUARRY_LOG_LEVEL=INFO
ENV KEYQUARRY_LOG_JSON=0
ENV KEYQUARRY_LOG_EVENTS=1
ENV KEYQUARRY_GRACEFUL_SHUTDOWN_TIMEOUT=30s
ENV KEYQUARRY_MAX_VALUE_SIZE=1000000
ENV KEYQUARRY_MAX_KEY_LENGTH=1000
ENV KEYQUARRY_MAX_LOCK_DURATION=1h
#ENV KEYQUARRY_MAX_KEYS=
ENV KEYQUARRY_REVISION_LIMIT=10
ENV KEYQUARRY_PRUNE_INTERVAL=30m
ENV KEYQUARRY_PRUNE_THRESHOLD=0.90
ENV KEYQUARRY_PRUNE_TARGET=0.80
ENV KEYQUARRY_EAGER_PRUNE=1
ENV KEYQUARRY_READONLY=0
#ENV KEYQUARRY_MAX_LOCK_DURATION=1h
ENV KEYQUARRY_SNAPSHOT_ENABLED=1
ENV KEYQUARRY_SNAPSHOT_INTERVAL=1h
ENV KEYQUARRY_SNAPSHOT_DATABASE=sqlite:///app/snapshots/snapshots.db
#ENV KEYQUARRY_SSL_CERTFILE=/etc/ssl/certs/KEYQUARRY.crt
#ENV KEYQUARRY_SSL_KEYFILE=/etc/ssl/certs/KEYQUARRY.key
#ENV GRPC_GO_LOG_VERBOSITY_LEVEL=99
#ENV GRPC_GO_LOG_SEVERITY_LEVEL=info
EXPOSE 33969
VOLUME /app/snapshots
ENTRYPOINT ["keyquarry", "serve"]