作者 陈志颖

fix:修改日志文件目录

... ... @@ -24,3 +24,4 @@
opp
/vendor
/*.exe~
logs
... ...
#FROM golang:1.14
#ENV APP_DIR $GOPATH/src/partner
#RUN mkdir -p $APP_DIR
#WORKDIR $APP_DIR/
#COPY ./pkg pkg
#COPY ./conf conf
#COPY ./go.mod go.mod
#COPY ./main.go main.go
#RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
#ENV GO111MODULE on
#ENV GOPROXY https://goproxy.cn,direct
#RUN ["go","mod","tidy"]
#RUN ["go","build"]
#EXPOSE 8082
#ENTRYPOINT ["./partner"]
############################
# STEP 1 build executable binary
############################
FROM golang:alpine AS builder
RUN mkdir /app
COPY . /app
WORKDIR /app
#RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" GOFLAGS="-mod=vendor" CGO_ENABLED=0 GOOS=linux go build -o partner
RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" CGO_ENABLED=0 GOOS=linux go build -o partner
FROM golang:1.14
ENV APP_DIR $GOPATH/src/partner
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR/
COPY ./pkg pkg
COPY ./conf conf
COPY ./go.mod go.mod
COPY ./main.go main.go
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
ENV GO111MODULE on
ENV GOPROXY https://goproxy.cn,direct
RUN ["go","mod","tidy"]
RUN ["go","build"]
EXPOSE 8082
ENTRYPOINT ["./partner"]
#############################
## STEP 1 build executable binary
#############################
#FROM golang:alpine AS builder
#
#RUN mkdir /app
#WORKDIR /app
#COPY . /app
#RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
##RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" GOFLAGS="-mod=vendor" CGO_ENABLED=0 GOOS=linux go build -o partner
#RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" CGO_ENABLED=0 GOOS=linux go build -o partner
#
#############################
## STEP 2 build a small image
############################
# STEP 2 build a small image
###########################
FROM scratch as final
COPY --from=builder /app/partner /app/partner
COPY --from=builder /app/conf/ /app/conf
ENTRYPOINT ["./app/partner"]
\ No newline at end of file
#FROM scratch as final
#COPY --from=builder /app/partner /app/partner
#COPY --from=builder /app/conf/ /app/conf
#ENTRYPOINT ["./app/partner"]
\ No newline at end of file
... ...
-----BEGIN CERTIFICATE-----
MIIGWjCCBUKgAwIBAgIQBKNf6ftifrIH+BeJ7V4uqjANBgkqhkiG9w0BAQsFADBf
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMR4wHAYDVQQDExVHZW9UcnVzdCBDTiBSU0EgQ0EgRzEw
HhcNMjEwMTA2MDAwMDAwWhcNMjIwMjA2MjM1OTU5WjCBgzELMAkGA1UEBhMCQ04x
EjAQBgNVBAgMCeemj+W7uuecgTESMBAGA1UEBwwJ56aP5bee5biCMTAwLgYDVQQK
DCfnpo/lu7rkubDkubDkubDkv6Hmga/np5HmioDmnInpmZDlhazlj7gxGjAYBgNV
BAMMESouZmptYWltYWltYWkuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEAv1KDwfoVuXyMSNUvLapWLpyWdQd8Dy4l5Wmdiydof4+ijqCfgPgMOZGS
7ucvis1ZUZLYDKbZq8xODVEWlXf/n6sMXkq0B+eltlYqyPOZyaBUkg2qqz/iKljb
1pGE5q7gfQ5nQoEW8J/DZUlKs+7jg9O0y2S0jVj3s7QlFy6Alw9BE/7ChOxqfegN
Ua0UL8W6rFqK32eyvZUeecvtKoZwJ3YD2ayXJIN70OivjkcWLskmf6+CjalitqQs
JZ7xD6/WtrpunTCpOVNqhR81sCOT+xxDwNppDqiMNo3lFL6TeQSWT19RBllkiWdW
XXfWS7CsIrqp8i/7fjt66VmVqZnPDwIDAQABo4IC6zCCAucwHwYDVR0jBBgwFoAU
kZ9eMRWuEJ+tYMH3wcyqSDQvDCY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Y+K6xvX9wtWB
h+3quFWuh0VTp15m6xAF1UN6HOG0uRKwUGFqwYBy4I+88KCUO3BJzbWn2TOjt4xE
8KVwGmZafqxPjwLagCN3RBLNYF4S+jhygBIlSzHkuVkwZPGbVet7NWkCgYEA0G0b
uDPJl37gEfvhMebdTWUq+FuAVx7h7UjZQM6BNoE3cDdZHUY7pMTqqD2UDbp6O6dC
0b8Hhs8kx90DewdixSzli67jNVeTRFY3DZ85Ac/BmGyuusNm6Uwbsz4RYsyUSrRD
bukC/L1vFjB5k/UgGh0kKnBT74mO/kqASWUIebcCgYEAiShtP6UX2VNuhPnSZ7rK
IkRSjJucB/ws5g5o//5R1FtGAVMbJllQHXK0iZsZH0NLrGjhUVoszWlxIOJshYlu
97ukgATlCEVdVmWjn33O1g6tRY1qhXuN0Zf+cqpDL6SLW0GjHx+UQVtoHFNMaFgC
HNZ6hgU9JyHzqTeMHv4vD+ECgYEAhk2oTPvh7OLuk+gQZk1zUMnd9IdRndHilzoX
9DCdBnghNwgTPk/hYv0YkCyN2ILO/N18qxdDTFTySG9cLMzHknKpv2aENf0mgiRj
+T0eSNKM1yFBPktnZvGJ7+gQ3+8fpzudMDyplh6jFFNMJFERzIH2qfoTvAiRwb5U
B/c4jOUCgYEAiQOXabnrnOvkfhl/RhH/WVeLs6O3c5yei0THysGc+9CqE8txnWPN
A4XI8Tu8G2ScBN+v9oPFWlLAZxbxh1m6RM6VwP4q+Y8fmdQ+d6gH/IKTdBjH7bOt
4SHS+t8Z6PSu8K1BsF3pGRS7OWPlivSJzRyP2YIgE/xtwsEqiODdRKM=
-----END RSA PRIVATE KEY-----
... ...
不能预览此文件类型
... ... @@ -8,7 +8,7 @@ import (
const SERVICE_NAME = "partner"
var LOG_LEVEL = "debug"
var LOG_File = "app.log"
var LOG_File = "logs/app.log"
var LOG_PREFIX = "[partner_dev]"
var MMM_SMS_SERVICE_HOST = "https://sms.fjmaimaimai.com:9897"
... ...
... ... @@ -2,9 +2,9 @@ package constant
import "os"
var REDIS_HOST = "127.0.0.1"
var REDIS_HOST = "192.168.100.6"
var REDIS_PORT = "6379"
var REDIS_AUTH = ""
var REDIS_AUTH = "1993618@jack"
func init() {
if os.Getenv("REDIS_HOST") != "" {
... ...