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