-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
31 lines (23 loc) · 1.02 KB
/
Dockerfile.dev
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
FROM golang:1.16 as build
RUN mkdir -p /build/matching-engine
WORKDIR /build/matching-engine/
# Force the go compiler to use modules
ENV GO111MODULE=on
ENV LOG_LEVEL="debug"
ENV LOG_FORMAT="pretty"
# We want to populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
# COPY go.sum .
# This is the ‘magic’ step that will download all the dependencies that are specified in
# the go.mod and go.sum file.
# Because of how the layer caching system works in Docker, the go mod download
# command will _ only_ be re-run when the go.mod or go.sum file change
# (or when we add another docker instruction below this line)
RUN go mod download
# Add code refresh package
RUN go get github.com/cespare/reflex
RUN echo "-r '(\.go$|go\.mod)' -s -- sh -c 'go run . --log-level=${LOG_LEVEL} --log-format=${LOG_FORMAT} server'" >> /reflex.conf
ENTRYPOINT ["reflex", "--decoration=none", "-c", "/reflex.conf"]
COPY . .
# RUN CGO_ENABLED=0 go build -a -installsuffix cgo --ldflags "-s -w" -o /usr/bin/matching_engine
EXPOSE 6060