forked from cloud-barista/cb-tumblebug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (48 loc) · 2.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
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
##############################################################
## Stage 1 - Go Build
##############################################################
FROM golang:1.16-alpine AS builder
#RUN apk update && apk add --no-cache bash
#RUN apk add gcc
RUN apk add --no-cache sqlite-libs sqlite-dev
RUN apk add --no-cache build-base
ADD . /go/src/github.com/cloud-barista/cb-tumblebug
WORKDIR /go/src/github.com/cloud-barista/cb-tumblebug
WORKDIR src
RUN go build -mod=mod -ldflags '-w -extldflags "-static"' -tags cb-tumblebug -o cb-tumblebug -v
#############################################################
## Stage 2 - Application Setup
##############################################################
FROM ubuntu:latest as prod
# use bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
WORKDIR /app/src
COPY --from=builder /go/src/github.com/cloud-barista/cb-tumblebug/assets/ /app/assets/
COPY --from=builder /go/src/github.com/cloud-barista/cb-tumblebug/conf/ /app/conf/
COPY --from=builder /go/src/github.com/cloud-barista/cb-tumblebug/src/cb-tumblebug /app/src/
#RUN /bin/bash -c "source /app/conf/setup.env"
ENV CBTUMBLEBUG_ROOT /app
ENV CBSTORE_ROOT /app
ENV CBLOG_ROOT /app
ENV SPIDER_CALL_METHOD REST
ENV DRAGONFLY_CALL_METHOD REST
ENV SPIDER_REST_URL http://cb-spider:1024/spider
ENV DRAGONFLY_REST_URL http://cb-dragonfly:9090/dragonfly
ENV DB_URL localhost:3306
ENV DB_DATABASE cb_tumblebug
ENV DB_USER cb_tumblebug
ENV DB_PASSWORD cb_tumblebug
ENV API_USERNAME default
ENV API_PASSWORD default
# Set period for auto control goroutine invocation
ENV AUTOCONTROL_DURATION_MS 10000
# Set SELF_ENDPOINT, if you want to access Swagger API dashboard from outside. (Ex: export SELF_ENDPOINT=xxx.xxx.xxx.xxx:1323)
ENV SELF_ENDPOINT localhost:1323
# Environment variables that you don't need to touch
# Ignore a protocol buffer namespace conflict
ENV GOLANG_PROTOBUF_REGISTRATION_CONFLICT ignore
# Swagger UI API document file path
ENV API_DOC_PATH /app/src/api/rest/docs/swagger.json
ENTRYPOINT [ "/app/src/cb-tumblebug" ]
EXPOSE 1323
EXPOSE 50252