作者 yangfu

Dockerfile修改

... ... @@ -12,4 +12,4 @@ ENV GOPROXY https://goproxy.io
RUN ["go","mod","tidy"]
RUN ["go","build"]
RUN ["ls"]
ENTRYPOINT ["./project"]
\ No newline at end of file
ENTRYPOINT ["./allied-creation-user"]
\ No newline at end of file
... ...
... ... @@ -76,7 +76,19 @@ spec:
valueFrom:
configMapKeyRef:
name: suplus-config
key: postgresql.port
key: postgresql.port
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: REDIS_AUTH
value: ""
- name: LOG_LEVEL
value: "debug"
- name: ERROR_BASE_CODE
... ... @@ -85,6 +97,8 @@ spec:
value: "1000"
- name: ENABLE_KAFKA_LOG
value: "true"
- name: HTTP_PORT
value: "8082"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@ import (
var SERVICE_NAME = "allied-creation-user"
var SERVICE_ENV = "dev"
var HTTP_PORT int = 8081
var CACHE_PREFIX = "allied-creation-user-dev"
var LOG_LEVEL = "debug"
... ... @@ -43,5 +44,8 @@ func init() {
if os.Getenv("SERVICE_ENV") != "" {
SERVICE_ENV = os.Getenv("SERVICE_ENV")
}
if os.Getenv("HTTP_PORT") != "" {
HTTP_PORT, _ = strconv.Atoi(os.Getenv("HTTP_PORT"))
}
CACHE_PREFIX = fmt.Sprintf("%v-%v", SERVICE_NAME, SERVICE_ENV)
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/beego/beego/v2/server/web/context"
"github.com/linmadan/egglib-go/log"
"github.com/linmadan/egglib-go/web/beego/filters"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
"os"
"strconv"
... ... @@ -16,7 +17,7 @@ func init() {
web.BConfig.AppName = "project"
web.BConfig.CopyRequestBody = true
web.BConfig.RunMode = "dev"
web.BConfig.Listen.HTTPPort = 8081
web.BConfig.Listen.HTTPPort = constant.HTTP_PORT
web.BConfig.Listen.EnableAdmin = false
web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego/routers"
if os.Getenv("RUN_MODE") != "" {
... ...