Adding a dockerfile to application

This commit is contained in:
Quentin Legot 2023-09-29 23:25:00 +02:00
parent 6d6b9a567f
commit b90e61cf66
2 changed files with 14 additions and 1 deletions

13
application/Dockerfile Normal file
View File

@ -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"]

View File

@ -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)