refactor: complete rewrite #17

Merged
Aire-One merged 5 commits from refactor/complete-rewrite into main 2024-09-23 23:55:44 +02:00
5 changed files with 16 additions and 8 deletions
Showing only changes of commit 17160e38cf - Show all commits

7
.dockerignore Normal file
View File

@ -0,0 +1,7 @@
.vscode
.woodpecker
configs
.*
renovate.json

View File

@ -4,9 +4,11 @@ FROM golang:1.23.1 AS builder
WORKDIR /app
COPY go.mod go.sum main.go ./
COPY go.mod go.sum ./
RUN go mod download
RUN go build
COPY . .
RUN go build -o labtime cmd/labtime/main.go
FROM gcr.io/distroless/base-debian12
@ -14,12 +16,10 @@ WORKDIR /
COPY --from=builder /app/labtime /labtime
# This is the port currently hardcoded in the application
EXPOSE 2112
# For now the config file path/name are hardcoded in the application
VOLUME ["/config"]
USER nonroot:nonroot
ENTRYPOINT ["/labtime"]
ENTRYPOINT ["/labtime"]

View File

@ -0,0 +1 @@
This is a docker compose stack example to run Prometheus with Grafana to play with the Labtime metrics.

View File

@ -5,12 +5,12 @@ services:
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data/prometheus.yaml:/etc/prometheus/prometheus.yaml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--config.file=/etc/prometheus/prometheus.yaml'
extra_hosts:
- "host.docker.internal:host-gateway"
grafana:
image: grafana/grafana
ports:
- 3000:3000
- 3000:3000