File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -20,24 +20,25 @@ RUN make static-build
20
20
# =================================
21
21
FROM alpine:3.8
22
22
23
+ RUN apk add --no-cache mysql-client
24
+
23
25
RUN mkdir -p /opt/repos
24
26
25
- ENV GITBASE_USER=root
26
- ENV GITBASE_PASSWORD=""
27
- ENV GITBASE_REPOS=/opt/repos
28
27
EXPOSE 3306
29
28
30
29
ENV TINI_VERSION v0.18.0
31
30
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64 /tini
32
31
RUN chmod +x /tini
33
32
ENTRYPOINT ["/tini" , "--" ]
34
33
34
+ ENV GITBASE_USER=root
35
+ ENV GITBASE_PASSWORD=""
36
+ ENV GITBASE_REPOS=/opt/repos
37
+ ENV MYSQL_HOST=127.0.0.1
38
+
35
39
# copy build artifacts
36
40
COPY --from=builder /bin/gitbase /bin/gitbase
41
+ ADD init.sh ./init.sh
42
+ RUN chmod +x ./init.sh
37
43
38
- CMD /bin/gitbase server -v \
39
- --host=0.0.0.0 \
40
- --port=3306 \
41
- --user="$GITBASE_USER" \
42
- --password="$GITBASE_PASSWORD" \
43
- --directories="$GITBASE_REPOS"
44
+ ENTRYPOINT ["./init.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ cat << EOT >> "$HOME /.my.cnf"
4
+ [client]
5
+ user=${GITBASE_USER}
6
+ password=${GITBASE_PASSWORD}
7
+ EOT
8
+
9
+ /tini -s -- /bin/gitbase server -v \
10
+ --host=0.0.0.0 \
11
+ --port=3306 \
12
+ --user=" $GITBASE_USER " \
13
+ --password=" $GITBASE_PASSWORD " \
14
+ --directories=" $GITBASE_REPOS "
You can’t perform that action at this time.
0 commit comments