docker files
This commit is contained in:
parent
d156dafd59
commit
61a42cca1b
3 changed files with 36 additions and 0 deletions
3
.env
Normal file
3
.env
Normal file
|
@ -0,0 +1,3 @@
|
|||
USERNAME=*****
|
||||
HUE_URL=192.168.178.34
|
||||
METRICS_FILE=******
|
14
Dockerfile.multistage
Normal file
14
Dockerfile.multistage
Normal file
|
@ -0,0 +1,14 @@
|
|||
FROM golang:alpine AS build
|
||||
WORKDIR /app
|
||||
COPY go.mod ./
|
||||
COPY go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN go build -o /hue_exporter
|
||||
|
||||
FROM alpine:latest
|
||||
WORKDIR /
|
||||
COPY --from=build /hue_exporter /hue_exporter
|
||||
EXPOSE 9773
|
||||
|
||||
ENTRYPOINT [ "sh", "-c", "/hue_exporter -username ${USERNAME} -hue-url ${HUE_URL} -metrics-file ${METRICS_FILE} " ]
|
19
docker-compose.yml
Normal file
19
docker-compose.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
stravakomootsync:
|
||||
image: hue_exporter
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile.multistage
|
||||
restart: unless-stopped
|
||||
container_name: hue_exporter
|
||||
ports:
|
||||
- 9773:9773
|
||||
env_file:
|
||||
- .env
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-file: "3"
|
||||
max-size: 10m
|
Loading…
Reference in a new issue