-
Notifications
You must be signed in to change notification settings - Fork 236
/
Copy pathDockerfile
40 lines (35 loc) · 868 Bytes
/
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
# -*- mode: dockerfile -*-
#
# A multi-stage Dockerfile that builds a Linux target then creates a small
# final image for deployment.
#
# STAGE 1
#
# Uses a Go image to build a release binary.
#
FROM golang:alpine AS builder
ARG tag=latest
ENV DOCKER_TAG=$tag
ENV GO111MODULE=on
RUN apk --no-cache add git make gcc g++
WORKDIR /go/src/github.com/alpacahq/marketstore/
ADD ./ ./
RUN make vendor
RUN make install plugins
#
# STAGE 2
#
# Use a tiny base image (alpine) and copy in the release target. This produces
# a very small output image for deployment.
#
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /
COPY --from=builder /go/bin/marketstore /bin/
COPY --from=builder /go/bin/*.so /bin/
RUN ["marketstore", "init"]
RUN mv mkts.yml /etc/
VOLUME /data
EXPOSE 5993
ENTRYPOINT ["marketstore"]
CMD ["start", "--config", "/etc/mkts.yml"]