Dockerise: add Dockerfile, compose, gitignore token from config

This commit is contained in:
2026-04-10 09:26:03 +02:00
parent 5a170736d6
commit c9f6ceb182
4 changed files with 21 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
bin/
config/config.json

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM golang:1.24-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -buildvcs=false -o pvcollect .
FROM alpine:latest
COPY --from=builder /build/pvcollect /usr/bin/pvcollect
ENTRYPOINT ["/usr/bin/pvcollect", "-c", "/etc/pvcollect/config.json"]

View File

@@ -89,4 +89,4 @@
] ]
} }
] ]
} }

8
docker-compose.yml Normal file
View File

@@ -0,0 +1,8 @@
services:
pvcollect:
build: .
container_name: pvcollect
restart: unless-stopped
network_mode: host
volumes:
- /srv/energy/pvcollect/config.json:/etc/pvcollect/config.json:ro