diff --git a/Dockerfile b/Dockerfile index f909a614..5572eca7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM alpine:latest RUN mkdir -p /app/gateway/plugins +ADD ./dist/ui/dist /app/gateway/ui ADD ./dist/proxy /app/gateway ADD ./dist/apiserver /app/gateway ADD ./dist/etcd /app/gateway diff --git a/Dockerfile-apiserver b/Dockerfile-apiserver index 0d6e6cf6..43ebaeef 100644 --- a/Dockerfile-apiserver +++ b/Dockerfile-apiserver @@ -1,5 +1,6 @@ FROM alpine:latest +ADD ./dist/ui/dist /app/gateway/ui ADD ./dist/apiserver /usr/local/bin/ RUN mkdir -p /var/apiserver/ diff --git a/Makefile b/Makefile index 904fea17..af5675e3 100644 --- a/Makefile +++ b/Makefile @@ -25,12 +25,16 @@ release: dist_dir apiserver proxy; release_darwin: darwin dist_dir apiserver proxy; .PHONY: docker -docker: release download_etcd; +docker: release download_etcd ui; @echo ========== current docker tag is: $(DOCKER_TAG) ========== docker build -t fagongzi/gateway:$(DOCKER_TAG) -f Dockerfile . docker build -t fagongzi/proxy:$(DOCKER_TAG) -f Dockerfile-proxy . docker build -t fagongzi/apiserver:$(DOCKER_TAG) -f Dockerfile-apiserver . +.PHONY: ui +ui: ; $(info ======== compile ui:) + git clone https://github.com/fagongzi/gateway-ui-vue.git $(DIST_DIR)ui + .PHONY: darwin darwin: $(eval GOOS := darwin) @@ -67,7 +71,6 @@ help: UNAME_S := $(shell uname -s) -# 设置默认编译目标 ifeq ($(UNAME_S),Darwin) .DEFAULT_GOAL := release_darwin else diff --git a/cmd/api/api_server.go b/cmd/api/api_server.go index bf1e7eea..01df72ed 100644 --- a/cmd/api/api_server.go +++ b/cmd/api/api_server.go @@ -29,7 +29,7 @@ var ( servicePrefix = flag.String("service-prefix", "/services", "The prefix for service name.") publishLease = flag.Int64("publish-lease", 10, "Publish service lease seconds") publishTimeout = flag.Int("publish-timeout", 30, "Publish service timeout seconds") - ui = flag.String("ui", "/app/gateway-ui", "The gateway ui dist dir.") + ui = flag.String("ui", "/app/gateway/ui", "The gateway ui dist dir.") uiPrefix = flag.String("ui-prefix", "/ui", "The gateway ui prefix path.") version = flag.Bool("version", false, "Show version info") )