sun-pc-linux 1 tháng trước cách đây
mục cha
commit
43ab6d3b16
4 tập tin đã thay đổi với 20 bổ sung21 xóa
  1. 3 3
      pack-nrhe/docker-compose.yaml
  2. 0 0
      pack-nrhe/template/readme.md
  3. 0 1
      src/Dockerfile
  4. 17 17
      src/main.go

+ 3 - 3
pack-nrhe/docker-compose.yaml

@@ -49,8 +49,8 @@ services:
       MONGO_INITDB_ROOT_USERNAME: root
       MONGO_INITDB_ROOT_PASSWORD: nrhe_zzzxxx
     volumes:
-      - ./data/mongo/db:/data/db
-      - ./data/mongo/log:/var/log/mongodb
+      - /data/nrhe/mongo/db:/data/db
+      - /data/nrhe/mongo/log:/var/log/mongodb
     ports: 
       - 17017:27017
 
@@ -60,7 +60,7 @@ services:
     depends_on:
       - nrhe-bus
     volumes:
-      - ./data/template:/root/projects/template
+      - ./template:/root/projects/template
       - ./mongo-migrations:/root/projects/migrations
     environment: 
       NATS: nats://nrhe-bus:4222

+ 0 - 0
src/template/readme.md → pack-nrhe/template/readme.md


+ 0 - 1
src/Dockerfile

@@ -5,7 +5,6 @@ RUN mkdir -p /root/projects
 
 WORKDIR /root/projects
 
-ADD ./template ./template
 ADD ./app.yaml ./app.yaml
 ADD ./nrhe-train ./nrhe-train
 

+ 17 - 17
src/main.go

@@ -2,11 +2,13 @@ package main
 
 import (
 	"flag"
-	"fmt"
 	"nrhe-train/api"
 	"nrhe-train/bus"
 	"nrhe-train/conf"
 	"nrhe-train/db"
+	"nrhe-train/log"
+
+	"infish.cn/comm"
 
 	"go.uber.org/dig"
 )
@@ -30,20 +32,18 @@ func BuildApp() *dig.Container {
 }
 
 func main() {
-	password := api.UtilMd5("123456")
-	fmt.Println(password)
-	// comm.AppMongoMiration()
-	// flag.Parse()
-	// app := BuildApp()
-	// err := app.Invoke(func(svc *api.Service, bus *comm.NatsBus) error {
-	// 	go bus.Run(nil)
-
-	// 	svc.Run()
-	// 	return nil
-	// })
-
-	// if err != nil {
-	// 	log.Errorf("the pink service start fail %+v", err)
-	// 	panic(err)
-	// }
+	comm.AppMongoMiration()
+	flag.Parse()
+	app := BuildApp()
+	err := app.Invoke(func(svc *api.Service, bus *comm.NatsBus) error {
+		go bus.Run(nil)
+
+		svc.Run()
+		return nil
+	})
+
+	if err != nil {
+		log.Errorf("the pink service start fail %+v", err)
+		panic(err)
+	}
 }