2018-08-22 03:54:56 +01:00
|
|
|
ARG GO_VERSION=1.10
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS build-env
|
2018-07-02 20:18:28 +01:00
|
|
|
RUN apk update && \
|
|
|
|
apk upgrade && \
|
|
|
|
apk add curl && \
|
|
|
|
apk add git
|
|
|
|
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
2018-06-21 20:36:39 +01:00
|
|
|
COPY . /go/src/storj.io/storj
|
2018-07-02 20:18:28 +01:00
|
|
|
RUN cd /go/src/storj.io/storj && dep ensure -vendor-only
|
2018-07-26 15:21:35 +01:00
|
|
|
RUN cd /go/src/storj.io/storj/cmd/hc && go build -o hc
|
2018-06-05 22:06:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
2018-07-02 20:18:28 +01:00
|
|
|
ENV REDIS_ADDRESS= \
|
|
|
|
REDIS_PASSWORD= \
|
|
|
|
REDIS_DB=0 \
|
|
|
|
OVERLAY_PORT=7070 \
|
|
|
|
HTTP_PORT=8080
|
2018-06-05 22:06:37 +01:00
|
|
|
WORKDIR /app
|
2018-07-26 15:21:35 +01:00
|
|
|
COPY --from=build-env /go/src/storj.io/storj/cmd/hc/hc /app/
|
2018-07-02 20:18:28 +01:00
|
|
|
EXPOSE 8081/udp \
|
|
|
|
8080 \
|
|
|
|
7070
|
2018-06-05 22:06:37 +01:00
|
|
|
|
2018-08-09 00:34:25 +01:00
|
|
|
ENTRYPOINT ./hc run --overlay.database-url redis://:${REDIS_PASSWORD}@${REDIS_ADDRESS}/?db=${REDIS_DB} --debug.addr=${HTTP_PORT} --identity.address=${OVERLAY_PORT}
|