diff --git a/Makefile b/Makefile index 684503aa..62389326 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,6 @@ docs: test: cd cmd/proxy && buffalo test cd cmd/olympus && buffalo test + +olympus-docker: + docker build -t gopackages/olympus -f cmd/olympus/Dockerfile . diff --git a/cmd/olympus/Dockerfile b/cmd/olympus/Dockerfile index 8d77fb18..ef5d6e82 100644 --- a/cmd/olympus/Dockerfile +++ b/cmd/olympus/Dockerfile @@ -1,19 +1,16 @@ # This is a multi-stage Dockerfile and requires >= Docker 17.05 # https://docs.docker.com/engine/userguide/eng-image/multistage-build/ +# +# use 'make olympus-docker' from the root of the athens repo to build +# the olympus docker image FROM gobuffalo/buffalo:v0.11.0 as builder -RUN mkdir -p $GOPATH/src/github.com/gomods/athens/cmd/olympus +RUN mkdir -p $GOPATH/src/github.com/gomods/athens +WORKDIR $GOPATH/src/github.com/gomods/athens +ADD . . WORKDIR $GOPATH/src/github.com/gomods/athens/cmd/olympus -# this will cache the npm install step, unless package.json changes -ADD cmd/olympus/package.json . -ADD cmd/olympus/yarn.lock . -RUN yarn install --no-progress - -WORKDIR $GOPATH/src/github.com/gomods/athens - -ADD . . -RUN cd cmd/olympus && buffalo build -s -o /bin/app +RUN buffalo build -s -o /bin/app FROM alpine RUN apk add --no-cache bash