fix: docker build
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details

This commit is contained in:
Aire-One 2024-09-23 03:54:23 +02:00
parent bcedc52d7c
commit 17160e38cf
5 changed files with 16 additions and 8 deletions

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 WORKDIR /app
COPY go.mod go.sum main.go ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
RUN go build
COPY . .
RUN go build -o labtime cmd/labtime/main.go
FROM gcr.io/distroless/base-debian12 FROM gcr.io/distroless/base-debian12
@ -14,12 +16,10 @@ WORKDIR /
COPY --from=builder /app/labtime /labtime COPY --from=builder /app/labtime /labtime
# This is the port currently hardcoded in the application
EXPOSE 2112 EXPOSE 2112
# For now the config file path/name are hardcoded in the application
VOLUME ["/config"] VOLUME ["/config"]
USER nonroot:nonroot 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: ports:
- 9090:9090 - 9090:9090
volumes: volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml - prometheus-data/prometheus.yaml:/etc/prometheus/prometheus.yaml
command: command:
- '--config.file=/etc/prometheus/prometheus.yml' - '--config.file=/etc/prometheus/prometheus.yaml'
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
grafana: grafana:
image: grafana/grafana image: grafana/grafana
ports: ports:
- 3000:3000 - 3000:3000