mirror of
https://github.com/skidoodle/ncore-stats.git
synced 2026-04-28 07:47:36 +02:00
Refactor application structure and enhance logging
- Introduced a Configuration struct to manage application settings. - Created a State struct to encapsulate application state and dependencies. - Replaced log package with logrus for improved logging capabilities. - Implemented graceful shutdown handling for the HTTP server. - Added context management for background tasks. - Updated database initialization to ensure tables are created. - Refactored user management functions to use the new State struct. - Enhanced error handling and logging throughout the application. - Updated README to reflect changes in user addition process.
This commit is contained in:
+7
-13
@@ -1,22 +1,16 @@
|
||||
FROM golang:alpine AS builder
|
||||
|
||||
RUN apk add --no-cache gcc musl-dev
|
||||
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/ncore-stats .
|
||||
|
||||
ENV CGO_ENABLED=1
|
||||
RUN go build -o ncore-stats .
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add ca-certificates
|
||||
WORKDIR /app/
|
||||
COPY --from=builder /build/trackncore .
|
||||
COPY --from=builder /build/data .
|
||||
COPY --from=builder /build/index.html .
|
||||
COPY --from=builder /build/script.js .
|
||||
COPY --from=builder /build/style.css .
|
||||
FROM alpine:3
|
||||
RUN apk add --no-cache ca-certificates
|
||||
WORKDIR /app
|
||||
COPY --from=builder /out/ncore-stats .
|
||||
COPY index.html style.css script.js ./
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["./ncore-stats"]
|
||||
|
||||
Reference in New Issue
Block a user