File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change
1
+ # ================================
2
+ # Stage 1: Build Gitbase
3
+ # ================================
4
+ FROM golang:1.11-alpine as gitbase-build
5
+
6
+ ENV GITBASE_REPO=github.com/src-d/gitbase
7
+ ENV GITBASE_PATH=$GOPATH/src/$GITBASE_REPO
8
+
9
+ COPY . $GITBASE_PATH
10
+ WORKDIR $GITBASE_PATH
11
+ RUN go build -ldflags="-s -w" -o /bin/gitbase ./cmd/gitbase
12
+
13
+ # =================================
14
+ # Stage 2: Start Gitbase Server
15
+ # =================================
1
16
FROM alpine:3.8
2
17
3
- COPY build/bin/gitbase /bin
4
18
RUN mkdir -p /opt/repos
5
19
6
20
ENV GITBASE_USER=root
@@ -11,12 +25,12 @@ EXPOSE 3306
11
25
ENV TINI_VERSION v0.18.0
12
26
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64 /tini
13
27
RUN chmod +x /tini
14
-
15
- RUN apk --no-cache add libxml2 git oniguruma libc6-compat
16
-
17
28
ENTRYPOINT ["/tini" , "--" ]
18
29
19
- CMD gitbase server -v \
30
+ # copy build artifacts
31
+ COPY --from=gitbase-build /bin/gitbase /bin/gitbase
32
+
33
+ CMD /bin/gitbase server -v \
20
34
--host=0.0.0.0 \
21
35
--port=3306 \
22
36
--user="$GITBASE_USER" \
You can’t perform that action at this time.
0 commit comments