Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ COPY go.mod .
COPY go.sum .
RUN go mod download

# Copy necessary parts of the Mail-Go source into builder's source
COPY *.go ./
COPY middleware middleware
COPY assets assets
COPY templates templates
# Copy all source
COPY *.go .
COPY middleware ./middleware

# Build to name "app".
RUN go build -o app .

EXPOSE 8080
# Wait until there's an actual MySQL connection we can use to start.
FROM alpine:latest
Comment thread
hwalker56 marked this conversation as resolved.

WORKDIR /AccountManager

COPY templates ./templates
COPY assets ./assets
COPY --from=builder /AccountManager/app .

EXPOSE 9011
CMD ["./app"]
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func main() {
r.GET("/login", LoginPage)
r.GET("/start", StartPanelHandler)
r.GET("/authorize", FinishPanelHandler)
r.GET("/health", HealthCheck)

auth := r.Group("/")
auth.Use(middleware.AuthenticationMiddleware(verifier))
Expand Down Expand Up @@ -91,3 +92,9 @@ func main() {
fmt.Printf("Starting HTTP connection (%s)...\nNot using the usual port for HTTP?\nBe sure to use a proxy, otherwise the Wii can't connect!\n", config.Address)
log.Fatalln(r.Run(config.Address))
}

func HealthCheck(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"status": "healthy",
})
}