-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (39 loc) · 1.22 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
FROM golang:1 as builder
ARG VERSION=unknown
WORKDIR /lc-api
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o ./bin/lc-api \
-ldflags="-X main.Version=$VERSION" \
-v ./cmd/lc-api/main.go
FROM alpine:3
ARG LC_API_DIR=/opt/lc-api
ARG LC_API_USER=lc-api
RUN apk update \
&& apk add ca-certificates tzdata \
&& rm -rf /var/cache/apk/*
RUN addgroup -S $LC_API_USER \
&& adduser -S $LC_API_USER -G $LC_API_USER \
&& mkdir -p $LC_API_DIR
COPY --from=builder /lc-api/bin/lc-api $LC_API_DIR/lc-api
RUN chown -R $LC_API_USER:$LC_API_USER $LC_API_DIR
ENV LC_API_RENDERER_ADDRESS=dns:///localhost:54020
ENV LC_API_RENDERER_CONN_TIMEOUT=5
ENV LC_API_RENDERER_REQUEST_TIMEOUT=30
ENV LC_API_GRPC_ADDRESS=0.0.0.0:54010
ENV LC_API_GRPC_SHUTDOWN_TIMEOUT=5
ENV LC_API_GRPC_HEALTH_CHECK_ADDRESS=0.0.0.0:54011
ENV LC_API_HTTP_ADDRESS=0.0.0.0:54012
ENV LC_API_HTTP_SHUTDOWN_TIMEOUT=5
ENV LC_API_HTTP_READ_TIMEOUT=5
ENV LC_API_HTTP_WRITE_TIMEOUT=10
ENV LC_API_HTTP_IDLE_TIMEOUT=120
ENV LC_METRICS_ADDRESS=0.0.0.0:54013
ENV LC_METRICS_SHUTDOWN_TIMEOUT=5
ENV LC_METRICS_READ_TIMEOUT=5
ENV LC_METRICS_WRITE_TIMEOUT=10
ENV LC_METRICS_IDLE_TIMEOUT=120
USER $LC_API_USER
WORKDIR $LC_API_DIR
ENTRYPOINT ["./lc-api"]
CMD []