-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
41 lines (30 loc) · 1.02 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
#-------------------------------------------
# STEP 1 : build executable binary
#-------------------------------------------
FROM golang:1.19-alpine as builder
# gcc
RUN apk add --no-cache build-base
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags '-w -extldflags "-static"' -tags cb-ladybug -o cb-ladybug -v src/main.go
#-------------------------------------------
# STEP 2 : build a image
#-------------------------------------------
FROM scratch as prod
COPY --from=builder /usr/src/app/conf/ /app/conf/
COPY --from=builder /usr/src/app/cb-ladybug /app/
COPY --from=builder /usr/src/app/src/scripts/ /app/src/scripts/
ENV CBLOG_ROOT "/app"
ENV CBSTORE_ROOT "/app"
ENV APP_ROOT "/app"
ENV SPIDER_CALL_METHOD REST
ENV TUMBLEBUG_CALL_METHOD REST
ENV SPIDER_URL http://cb-spider:1024/spider
ENV TUMBLEBUG_URL http://cb-tumblebug:1323/tumblebug
ENV BASE_PATH /ladybug
ENV LOG_LEVEL "info"
ENV API_USERNAME default
ENV API_PASSWORD default
ENTRYPOINT [ "/app/cb-ladybug" ]
EXPOSE 1470
EXPOSE 50254