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:
parent
a65aa3ecef
commit
37b54962a2
4 changed files with 98 additions and 72 deletions
16
Makefile
16
Makefile
|
@ -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
8
dashboard/.dockerignore
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/node_modules
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
14
dashboard/Dockerfile.build
Normal file
14
dashboard/Dockerfile.build
Normal 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
Loading…
Reference in a new issue