2018-07-02 20:18:28 +01:00
|
|
|
FROM golang:1.10-alpine AS build-env
|
|
|
|
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-07-26 15:21:35 +01:00
|
|
|
ENTRYPOINT ./hc --pointer-db.database-url redis://:${REDIS_PASSWORD}@${REDIS_ADDRESS}/?db=${REDIS_DB} --debug.addr=${HTTP_PORT} --identity.address=${OVERLAY_PORT}
|