diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5040ac6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:latest + +WORKDIR /app + +COPY . . + +RUN go mod download + +EXPOSE 4040 + +CMD ["go", "run", "main.go"] diff --git a/main.go b/main.go index 700b8e2..bb1d81e 100644 --- a/main.go +++ b/main.go @@ -92,19 +92,15 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) { func main() { Chibisafe_basepath := os.Getenv("CHIBISAFE_BASEPATH") - Host := os.Getenv("HOST") if Chibisafe_basepath == "" { log.Fatal("CHIBISAFE_BASEPATH environment is not set!") } - if Host == "" { - Host = "127.0.0.1:4000" - } mux := http.NewServeMux() mux.HandleFunc("/api/v1/upload", uploadHandler) - if err := http.ListenAndServe(Host, mux); err != nil { + if err := http.ListenAndServe(":4040", mux); err != nil { log.Fatal(err) } }