Dockerise: add Dockerfile, compose, gitignore token from config
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bin/
|
||||||
|
config/config.json
|
||||||
10
Dockerfile
Normal file
10
Dockerfile
Normal 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"]
|
||||||
@@ -89,4 +89,4 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal 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
|
||||||
Reference in New Issue
Block a user