Cleanup Dockerfiles (#437)

* Cleanup Dockerfiles

* Responding to review feedback

* Preventing host copy of local  and  directories from being copied into builder containers.
This commit is contained in:
Martin Strobel
2018-08-13 15:59:41 -07:00
committed by Aaron Schlesinger
parent 5f02ada292
commit 106d8c3631
3 changed files with 16 additions and 6 deletions
+2
View File
@@ -0,0 +1,2 @@
**/node_modules/
**/bin/
+4 -2
View File
@@ -35,14 +35,16 @@ test-unit:
test-e2e:
./scripts/test_e2e.sh
.PHONY: docker
docker: olympus-docker proxy-docker
.PHONY: olympus-docker
olympus-docker:
docker build -t gomods/olympus -f cmd/olympus/Dockerfile .
.PHONY: proxy-docker
proxy-docker:
# TODO: this needs to change to gomods/proxy
docker build -t gomods/athens -f cmd/proxy/Dockerfile .
docker build -t gomods/proxy -f cmd/proxy/Dockerfile .
bench:
./scripts/benchmark.sh
+10 -4
View File
@@ -5,12 +5,18 @@
# the olympus docker image
FROM gobuffalo/buffalo:v0.11.0 as builder
RUN mkdir -p $GOPATH/src/github.com/gomods/athens
WORKDIR $GOPATH/src/github.com/gomods/athens
ADD . .
RUN mkdir -p $GOPATH/src/github.com/gomods/athens/cmd/olympus
WORKDIR $GOPATH/src/github.com/gomods/athens/cmd/olympus
RUN buffalo build -s -o /bin/app
# 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
FROM alpine
RUN apk add --no-cache bash