forked from RTradeLtd/Temporal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (31 loc) · 922 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
# Set up Golang build environment
FROM golang:1.14.1-alpine3.11 AS build-env
ARG TEMPORALVERSION
ENV BUILD_HOME=/go/src/github.com/RTradeLtd/Temporal \
TEMPORALVERSION=${TEMPORALVERSION} \
GO111MODULE=on
# Mount source code
ADD . ${BUILD_HOME}
WORKDIR ${BUILD_HOME}
# Install dependencies
RUN apk add --no-cache git
RUN go mod vendor
# Build temporal binary
RUN go build -o /bin/temporal \
-ldflags "-X main.Version=$TEMPORALVERSION" \
./cmd/temporal
# Copy binary into clean image
FROM alpine
LABEL maintainer "RTrade Technologies Ltd."
RUN mkdir -p /daemon
WORKDIR /daemon
COPY --from=build-env /bin/temporal /usr/local/bin
# Set up directories
RUN mkdir /temporal \
mkdir -p /var/log/temporal
# Set default configuration
COPY ./testenv/config.json /temporal/config.json
# Set default command
ENTRYPOINT [ "temporal", "-config", "/temporal/config.json" ]
# Run API by default
CMD [ "api" ]