diff --git a/application/Dockerfile b/application/Dockerfile new file mode 100644 index 0000000..1679bb8 --- /dev/null +++ b/application/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1.21 + +WORKDIR /usr/src/app + +COPY go.mod go.sum ./ +RUN go mod download && go mod verify +COPY main.go main.go +RUN go build -v -o /usr/local/bin/app ./main.go + +ENV PORT_LISTENING=8080 +ENV JSON_LOCATION=https://git.altarik.fr/Altarik/launcher_json/raw/branch/master/launcher.json +EXPOSE 8080 +CMD ["app"] diff --git a/application/main.go b/application/main.go index f0f8355..958afcc 100644 --- a/application/main.go +++ b/application/main.go @@ -14,7 +14,7 @@ import ( func main() { err := godotenv.Load() if err != nil { - log.Fatal("Error loading .env file") + log.Println("Error loading .env file -- ignore if production") } r := gin.Default() r.GET("/", getLauncherJson)