added url for log manager server
parent
d35ed4f181
commit
4027153c5b
25
Dockerfile
25
Dockerfile
|
@ -3,15 +3,10 @@ FROM golang:latest AS go_builder
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./backend/main /app/main
|
||||
#COPY ./backend/grouptasks_lang_log_messages.json /app/
|
||||
#COPY ./backend/system_lang_log_messages.json /app/
|
||||
#COPY ./backend/public/swagger/ /app/swagger
|
||||
|
||||
# Assuming you build your Go binary using "go build -o main"
|
||||
#RUN go build -o main
|
||||
COPY ./admin-dashboard-backend/main /app/main
|
||||
|
||||
# Stage 2: Create the final image with Python 3 and the Go binary
|
||||
# Python is needed for the group tasks
|
||||
FROM python:3
|
||||
|
||||
WORKDIR /app
|
||||
|
@ -19,23 +14,9 @@ WORKDIR /app
|
|||
# Copy the Go binary from the previous stage
|
||||
COPY --from=go_builder /app/main /app/main
|
||||
|
||||
# Copy any other files you need
|
||||
COPY ./backend/grouptasks_lang_log_messages.json /app/
|
||||
COPY ./backend/system_lang_log_messages.json /app/
|
||||
COPY ./backend/public/swagger/ /app/swagger
|
||||
COPY ./admin-dashboard-backend/public/swagger/ /app/swagger
|
||||
|
||||
# Set up any Python dependencies you might need
|
||||
# RUN pip install ...
|
||||
|
||||
CMD ["./main"]
|
||||
|
||||
#FROM golang:latest
|
||||
|
||||
#WORKDIR /app
|
||||
|
||||
#COPY ./backend/main /app/main
|
||||
#COPY ./backend/grouptasks_lang_log_messages.json /app/
|
||||
#COPY ./backend/system_lang_log_messages.json /app/
|
||||
#COPY ./backend/public/swagger/ /app/swagger
|
||||
|
||||
#CMD ["./main"]
|
|
@ -14,6 +14,7 @@ type Config struct {
|
|||
ColorizedOutput bool
|
||||
Host string
|
||||
Port string
|
||||
LogManagerServerUrl string
|
||||
FolderPaths FolderPaths
|
||||
MariaDB MariaDB
|
||||
InvexAPI InvexAPI
|
||||
|
@ -54,6 +55,7 @@ func LoadConfig() {
|
|||
ColorizedOutput: os.Getenv("COLORIZED_OUTPUT") == "true",
|
||||
Host: os.Getenv("HOST"),
|
||||
Port: os.Getenv("PORT"),
|
||||
LogManagerServerUrl: os.Getenv("LOG_MANAGER_SERVER_URL"),
|
||||
FolderPaths: FolderPaths{
|
||||
GroupTasksGroups: os.Getenv("FOLDER_GROUPTASKS_GROUPS"),
|
||||
GroupTasksRunningTasks: os.Getenv("FOLDER_GROUPTASKS_RUNNINGTASKS"),
|
||||
|
|
|
@ -12,9 +12,6 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
//var systemLanguageLogMessages []structs.LanguageLogMessages
|
||||
//var grouptasksLanguageLogMessages []structs.LanguageLogMessages
|
||||
|
||||
func InitLogger() {
|
||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||
|
||||
|
@ -34,13 +31,13 @@ func getTime() string {
|
|||
}
|
||||
|
||||
func AddSystemLog(format string, v ...any) {
|
||||
go LogManagerRequestClient(fiber.MethodPost, "http://localhost:50110/v1/log", LogManagerRequestBody{
|
||||
go LogManagerRequestClient(fiber.MethodPost, config.Cfg.LogManagerServerUrl+"/v1/log", LogManagerRequestBody{
|
||||
Type: "system",
|
||||
Logs: []string{"I " + getTime() + fmt.Sprintf(format, v...)}})
|
||||
}
|
||||
|
||||
func AddGroupTasksLog(format string, v ...any) {
|
||||
go LogManagerRequestClient(fiber.MethodPost, "http://localhost:50110/v1/log", LogManagerRequestBody{
|
||||
go LogManagerRequestClient(fiber.MethodPost, config.Cfg.LogManagerServerUrl+"/v1/log", LogManagerRequestBody{
|
||||
Type: "grouptasks",
|
||||
Logs: []string{"I " + getTime() + fmt.Sprintf(format, v...)}})
|
||||
}
|
||||
|
|
|
@ -9,9 +9,6 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
//const Base = "https://inv.ex.umbach.dev"
|
||||
//const ApiBase = Base + "/api"
|
||||
|
||||
func InvexApiRequestClient(requestMethod string, url string) (statusCode int, body []byte, err error) {
|
||||
a := fiber.AcquireAgent()
|
||||
|
||||
|
|
Loading…
Reference in New Issue