This commit is contained in:
joy.zhou
2019-07-15 12:07:37 +08:00
parent cd4c1a5a3a
commit 333819b2f2
3 changed files with 3 additions and 5 deletions

View File

@@ -8,6 +8,6 @@ RUN CGO_ENABLED=0 go build -o hmq -a -ldflags '-extldflags "-static"' .
FROM alpine:3.8 FROM alpine:3.8
WORKDIR / WORKDIR /
COPY --from=builder /go/src/github.com/fhmq/hmq/hmq . COPY --from=builder /go/src/github.com/fhmq/hmq/hmq .
EXPOSE 50010 EXPOSE 1883
CMD ["/hmq"] CMD ["/hmq"]

View File

@@ -33,7 +33,7 @@ type Config struct {
//Init init kafak client //Init init kafak client
func Init() { func Init() {
content, err := ioutil.ReadFile("./plugins/authhttp/http.json") content, err := ioutil.ReadFile("/plugins/authhttp/http.json")
if err != nil { if err != nil {
log.Fatal("Read config file error: ", zap.Error(err)) log.Fatal("Read config file error: ", zap.Error(err))
} }

View File

@@ -37,14 +37,12 @@ type Config struct {
//Init init kafak client //Init init kafak client
func Init() { func Init() {
log.Info("start connect kafka....") log.Info("start connect kafka....")
content, err := ioutil.ReadFile("./plugins/kafka/kafka.json") content, err := ioutil.ReadFile("/plugins/kafka/kafka.json")
if err != nil { if err != nil {
log.Fatal("Read config file error: ", zap.Error(err)) log.Fatal("Read config file error: ", zap.Error(err))
} }
// log.Info(string(content)) // log.Info(string(content))
log.Info("end connect kafka....")
err = json.Unmarshal(content, &config) err = json.Unmarshal(content, &config)
if err != nil { if err != nil {
log.Fatal("Unmarshal config file error: ", zap.Error(err)) log.Fatal("Unmarshal config file error: ", zap.Error(err))