diff --git a/.env b/.env.example similarity index 100% rename from .env rename to .env.example diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index b5e7726..5999070 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -23,4 +23,4 @@ jobs: with: context: . push: true - tags: ghcr.io/appwrite/monitoring:${{ env.TAG }} + tags: ghcr.io/appwrite/monitoring:${{ github.event.release.tag_name }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2eea525 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a5f7878..3fa67f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,32 +2,20 @@ FROM golang:1.21-alpine AS builder WORKDIR /app -# Install build dependencies RUN apk add --no-cache gcc musl-dev -# Copy go mod files -COPY go.mod go.sum ./ - -# Download dependencies -RUN go mod download - -# Copy source code COPY . . -# Build the application -RUN CGO_ENABLED=1 GOOS=linux go build -a -o monitoring . +RUN go mod download -# Copy the monitoring binary to /usr/local/bin to make it available in PATH -COPY monitoring /usr/local/bin/monitoring -RUN chmod +x /usr/local/bin/monitoring +RUN go build -o monitoring . -# Final stage -FROM alpine:3.19 +FROM alpine:3.19 AS final WORKDIR /app -# Install runtime dependencies RUN apk add --no-cache ca-certificates -# Copy binary from builder -COPY --from=builder /app/monitoring . \ No newline at end of file +COPY --from=builder /app/monitoring /usr/local/bin/monitoring + +RUN chmod +x /usr/local/bin/monitoring \ No newline at end of file diff --git a/README.md b/README.md index 8386f0e..756f31c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # System Monitoring -A lightweight system monitoring tool that tracks CPU, memory, and disk usage across your infrastructure. When resource usage exceeds defined thresholds, it creates incidents in BetterStack (formerly BetterUptime). +A lightweight system monitoring tool that tracks CPU, memory, and disk usage across your infrastructure. When resource usage exceeds defined thresholds, it creates incidents in BetterStack. ## Features