1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Building dashboard in docker

This commit is contained in:
Ewout Prangsma 2018-07-06 08:14:51 +02:00
parent a65aa3ecef
commit 37b54962a2
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698
4 changed files with 98 additions and 72 deletions

View file

@ -72,6 +72,7 @@ endif
ifndef ENTERPRISEIMAGE ifndef ENTERPRISEIMAGE
ENTERPRISEIMAGE := $(DEFAULTENTERPRISEIMAGE) ENTERPRISEIMAGE := $(DEFAULTENTERPRISEIMAGE)
endif endif
DASHBOARDBUILDIMAGE := kube-arangodb-dashboard-builder
ifndef ALLOWCHAOS ifndef ALLOWCHAOS
ALLOWCHAOS := true ALLOWCHAOS := true
@ -111,7 +112,7 @@ build: check-vars docker manifests
.PHONY: clean .PHONY: clean
clean: clean:
rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/node_modules rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/build $(DASHBOARDDIR)/node_modules
.PHONY: check-vars .PHONY: check-vars
check-vars: check-vars:
@ -191,11 +192,14 @@ update-generated: $(GOBUILDDIR)
verify-generated: verify-generated:
@${MAKE} -B -s VERIFYARGS=--verify-only update-generated @${MAKE} -B -s VERIFYARGS=--verify-only update-generated
$(DASHBOARDDIR)/node_modules: dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/Dockerfile.build
cd $(DASHBOARDDIR) && npm install cd $(DASHBOARDDIR) && docker build -t $(DASHBOARDBUILDIMAGE) -f Dockerfile.build $(DASHBOARDDIR)
@mkdir -p $(DASHBOARDDIR)/build
dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/node_modules docker run --rm \
cd $(DASHBOARDDIR) && npm run-script build -v $(DASHBOARDDIR)/build:/usr/code/build \
-v $(DASHBOARDDIR)/public:/usr/code/public:ro \
-v $(DASHBOARDDIR)/src:/usr/code/src:ro \
$(DASHBOARDBUILDIMAGE)
$(GOASSETSBUILDER) -s /dashboard/build/ -o dashboard/assets.go -p dashboard dashboard/build $(GOASSETSBUILDER) -s /dashboard/build/ -o dashboard/assets.go -p dashboard dashboard/build
$(BIN): $(GOBUILDDIR) $(CACHEVOL) $(SOURCES) dashboard/assets.go $(BIN): $(GOBUILDDIR) $(CACHEVOL) $(SOURCES) dashboard/assets.go

8
dashboard/.dockerignore Normal file
View file

@ -0,0 +1,8 @@
/node_modules
# testing
/coverage
# production
/build

View file

@ -0,0 +1,14 @@
FROM node:10.6-alpine
RUN mkdir -p /usr/code
ADD package-lock.json /usr/code/
ADD package.json /usr/code/
RUN cd /usr/code/ && npm install
VOLUME /usr/code/build
VOLUME /usr/code/public
VOLUME /usr/code/src
WORKDIR /usr/code/
CMD ["npm", "run-script", "build"]

File diff suppressed because one or more lines are too long