26 lines
446 B
Docker
26 lines
446 B
Docker
# ---- Build Stage ----
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --link go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY --link . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o dashboard-server .
|
|
|
|
# ---- Runtime Stage ----
|
|
FROM alpine:3.22
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --link static/ ./static/
|
|
|
|
COPY --link --from=builder /app/dashboard-server /app/dashboard-server
|
|
|
|
EXPOSE 9099
|
|
|
|
ENV SERVER_PORT="9099"
|
|
|
|
CMD ["/app/dashboard-server"] |