-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 980 Bytes
/
Dockerfile
File metadata and controls
52 lines (37 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM golang:1.21-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git make nodejs npm
# Set working directory
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build frontend
WORKDIR /app/web
RUN npm install && npm run build
# Build backend
WORKDIR /app
RUN make build
# Final stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata
# Create app user
RUN addgroup -g 1000 gauge && \
adduser -D -u 1000 -G gauge gauge
WORKDIR /home/gauge
# Copy binary from builder
COPY --from=builder /app/build/html-report-enhanced /usr/local/bin/
COPY --from=builder /app/web/themes /home/gauge/themes
COPY --from=builder /app/plugin.json /home/gauge/
# Set ownership
RUN chown -R gauge:gauge /home/gauge
# Switch to non-root user
USER gauge
# Expose port for serve command
EXPOSE 8080
# Default command
ENTRYPOINT ["html-report-enhanced"]
CMD ["--help"]