Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

基于part8一次完整部署所发现的问题 #197

Open
umelly opened this issue Dec 3, 2019 · 2 comments
Open

基于part8一次完整部署所发现的问题 #197

umelly opened this issue Dec 3, 2019 · 2 comments

Comments

@umelly
Copy link

umelly commented Dec 3, 2019

4处错误

  • web类项目的Dockerfile都多了一行 ADD html /html
  • config-grpc-srv配置文件错误
inv_srv:
    name: mu.micro.book.srv.inv 
 
正确的
inv_srv:
    name: mu.micro.book.srv.inventory
  • payment-srv、payment-web配置中心地址写死了
func initCfg() {
	source := grpc.NewSource(
		grpc.WithAddress("127.0.0.1:9600"),
		grpc.WithPath("micro"),
	)
        ...
}

需改成
func initCfg() {
	configAddr := os.Getenv("MICRO_BOOK_CONFIG_GRPC_ADDR")
	source := grpc.NewSource(
		grpc.WithAddress(configAddr),
		grpc.WithPath("micro"),
	)
        ...
}

  • docs/schema.sql 重复了几个table

一处不完善之处

config-grpc-srv其实也是一个srv,但是没写部署文件,可以参考下面加下
Makefile

GOPATH:=$(shell go env GOPATH)

.PHONY: build
build:
	GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o config-grpc-srv main.go

.PHONY: docker
docker:docker
	docker build . -t config-grpc-srv:latest

Dockerfile

FROM alpine

RUN apk update && apk add tzdata && cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ADD config-grpc-srv /config-grpc-srv
ADD conf/micro.yml /conf/micro.yml

ENTRYPOINT [ "/config-grpc-srv" ]
@printfcoder
Copy link
Owner

Hi,非常感谢批评指正,可以帮忙PR贡献进来吗?

@umelly
Copy link
Author

umelly commented Dec 5, 2019

没问题

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants