-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 804 Bytes
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 804 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
# Crucible Monitor Docker Image
FROM golang:1.21-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o crucible-monitor .
FROM alpine:latest
# Install ca-certificates for HTTPS requests
RUN apk --no-cache add ca-certificates
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 -S crucible && \
adduser -u 1001 -S crucible -G crucible
# Copy binary and configs
COPY --from=builder /app/crucible-monitor .
COPY --from=builder /app/configs ./configs
# Create data directory
RUN mkdir -p /data && chown crucible:crucible /data
USER crucible
EXPOSE 9090
# Environment variables (override with docker run -e)
ENV RESEND_API_KEY=""
ENV ALERT_FROM_EMAIL=""
ENV ALERT_FROM_NAME="Crucible Monitor"
CMD ["./crucible-monitor"]