Skip to content

Commit

Permalink
dev: add ui into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxu19830126 committed Nov 22, 2018
1 parent 1f435dc commit 8b30b78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Dockerfile-apiserver
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -67,7 +71,6 @@ help:

UNAME_S := $(shell uname -s)

# 设置默认编译目标
ifeq ($(UNAME_S),Darwin)
.DEFAULT_GOAL := release_darwin
else
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/api_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
Expand Down

0 comments on commit 8b30b78

Please sign in to comment.