Skip to content

Commit b71e57c

Browse files
authored
Merge pull request #206 from erizocosmico/feature/docker-img
add dockerfile
2 parents aca78f8 + 6ca6938 commit b71e57c

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ deploy:
5050
skip_cleanup: true
5151
on:
5252
tags: true
53+
54+
after_deploy:
55+
- DOCKER_PUSH_LATEST=1 make docker-push

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM golang:1.10 as builder
2+
3+
RUN mkdir -p /go/src/github.com/src-d/gitbase
4+
WORKDIR /go/src/github.com/src-d/gitbase
5+
COPY . .
6+
7+
RUN apt-get update && apt-get install libxml2-dev -y
8+
RUN go get github.com/golang/dep/...
9+
RUN dep ensure
10+
RUN cd vendor/gopkg.in/bblfsh/client-go.v2 && make dependencies
11+
RUN go install -v github.com/src-d/gitbase/...
12+
13+
FROM ubuntu:16.04
14+
15+
COPY --from=builder /go/bin/gitbase /bin
16+
RUN mkdir -p /opt/repos
17+
18+
ENV GITBASE_USER=gitbase
19+
ENV GITBASE_PASSWORD=""
20+
EXPOSE 3306
21+
22+
ENV TINI_VERSION v0.17.0
23+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
24+
RUN chmod +x /tini
25+
26+
RUN apt-get update \
27+
&& apt-get install libxml2-dev git -y \
28+
&& apt-get clean \
29+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
30+
31+
ENTRYPOINT ["/tini", "--"]
32+
33+
CMD gitbase server -v \
34+
--host=0.0.0.0 \
35+
--port=3306 \
36+
--user="$GITBASE_USER" \
37+
--password="$GITBASE_PASSWORD" \
38+
--git=/opt/repos

0 commit comments

Comments
 (0)