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
|
||||
ENTERPRISEIMAGE := $(DEFAULTENTERPRISEIMAGE)
|
||||
endif
|
||||
DASHBOARDBUILDIMAGE := kube-arangodb-dashboard-builder
|
||||
|
||||
ifndef ALLOWCHAOS
|
||||
ALLOWCHAOS := true
|
||||
|
@ -111,7 +112,7 @@ build: check-vars docker manifests
|
|||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/node_modules
|
||||
rm -Rf $(BIN) $(BINDIR) $(GOBUILDDIR) $(DASHBOARDDIR)/build $(DASHBOARDDIR)/node_modules
|
||||
|
||||
.PHONY: check-vars
|
||||
check-vars:
|
||||
|
@ -191,11 +192,14 @@ update-generated: $(GOBUILDDIR)
|
|||
verify-generated:
|
||||
@${MAKE} -B -s VERIFYARGS=--verify-only update-generated
|
||||
|
||||
$(DASHBOARDDIR)/node_modules:
|
||||
cd $(DASHBOARDDIR) && npm install
|
||||
|
||||
dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/node_modules
|
||||
cd $(DASHBOARDDIR) && npm run-script build
|
||||
dashboard/assets.go: $(DASHBOARDSOURCES) $(DASHBOARDDIR)/Dockerfile.build
|
||||
cd $(DASHBOARDDIR) && docker build -t $(DASHBOARDBUILDIMAGE) -f Dockerfile.build $(DASHBOARDDIR)
|
||||
@mkdir -p $(DASHBOARDDIR)/build
|
||||
docker run --rm \
|
||||
-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
|
||||
|
||||
$(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