Commit e65ffd2e authored by 贾浩@五瓣科技's avatar 贾浩@五瓣科技

update dockerfile

parent 418a0713
Pipeline #790 canceled with stages
......@@ -2,6 +2,8 @@ package main
import (
"flag"
"io"
"os"
"sdk_api/config"
"sdk_api/dao"
messager "sdk_api/messenger"
......@@ -11,14 +13,19 @@ import (
log "github.com/sirupsen/logrus"
)
func init() {
func initLog() {
file, _ := os.OpenFile("log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
mw := io.MultiWriter(os.Stdout, file)
log.SetOutput(mw)
log.SetFormatter(&log.TextFormatter{
FullTimestamp: true,
})
}
func main() {
initLog()
flag.Parse()
cfg, err := config.New()
if err != nil {
panic(err)
......
......@@ -2,6 +2,8 @@ package main
import (
"flag"
"io"
"os"
"sdk_api/config"
"sdk_api/dao"
messager "sdk_api/messenger"
......@@ -9,14 +11,19 @@ import (
log "github.com/sirupsen/logrus"
)
func init() {
func initLog() {
file, _ := os.OpenFile("log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
mw := io.MultiWriter(os.Stdout, file)
log.SetOutput(mw)
log.SetFormatter(&log.TextFormatter{
FullTimestamp: true,
})
}
func main() {
initLog()
flag.Parse()
cfg, err := config.New()
if err != nil {
panic(err)
......
......@@ -15,6 +15,7 @@ services:
volumes:
- ./conf/tg-messenger/config.toml:/config.toml
- ./data/tg-messenger/api.log:/app/log
command:
- "/bin/sh"
- "-c"
......@@ -32,6 +33,7 @@ services:
volumes:
- ./conf/tg-messenger/config.toml:/config.toml
- ./data/tg-messenger/messenger.log:/app/log
command:
- "/bin/sh"
- "-c"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment