-
Notifications
You must be signed in to change notification settings - Fork 30
/
mock.Dockerfile
46 lines (29 loc) · 1.08 KB
/
mock.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
# --------------------------------------------------
FROM golang:alpine AS agent
WORKDIR $GOPATH/src/app
COPY . .
RUN go build ./cli/pprotein-agent
# --------------------------------------------------
FROM golang:alpine AS mock
WORKDIR $GOPATH/src/app
COPY . .
RUN go build ./cli/pprotein-mock
# --------------------------------------------------
FROM alpine/git AS repo
WORKDIR /opt
RUN git clone https://github.com/kaz/pprotein.git
# --------------------------------------------------
FROM alpine
RUN apk add --no-cache mysql mysql-client nginx supervisor
RUN mysql_install_db --datadir=/var/lib/mysql --basedir=/usr --user=root
RUN mkdir /var/log/mysql
COPY --from=agent /go/src/app/pprotein-agent /usr/local/bin/
COPY --from=mock /go/src/app/pprotein-mock /usr/local/bin/
COPY --from=repo /opt/pprotein /opt/pprotein
COPY mock/supervisord.ini /etc/supervisor.d/
COPY mock/mysqld.cnf /etc/my.cnf.d/
COPY mock/nginx.conf /etc/nginx/
ENV DSN "root@unix(/var/run/mysqld/mysqld.sock)/"
ENV REQUEST_HOST "127.0.0.1:80"
ENV PPROTEIN_GIT_REPOSITORY "/opt/pprotein"
ENTRYPOINT ["supervisord"]