-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dockerfile, compose-file + github workflow
- Loading branch information
1 parent
e2a8b83
commit 419c3cf
Showing
4 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM golang:1.21-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN go build -o weather-exporter . | ||
|
||
|
||
|
||
FROM alpine:latest | ||
RUN addgroup -S app && adduser -S app -G app | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/weather-exporter . | ||
|
||
EXPOSE 8080 | ||
USER app | ||
CMD ["./weather-exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3.8' | ||
|
||
services: | ||
weather-exporter: | ||
build: . | ||
environment: | ||
- WEATHER_EXPORTER_WEBSERVERPORT=8082 | ||
- WEATHER_EXPORTER_LOGLEVEL=info | ||
- WEATHER_EXPORTER_JSONEXPORTER_ENABLED=true | ||
- WEATHER_EXPORTER_PROMETHEUSEXPORTER_ENABLED=true | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_ENABLED=false | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_SERVER=1.2.3.4 | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_PORT=8086 | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_ORG=<org> | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_TOKEN=<token> # or <username>:<password> | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_DATABASE=<database(bucket)> | ||
- WEATHER_EXPORTER_INFLUXDBEXPORTER_MEASUREMENT=<measurement> | ||
- WEATHER_EXPORTER_MQTT_ENABLED=false | ||
- WEATHER_EXPORTER_MQTT_BROKERADDRESS=1.2.3.4 | ||
- WEATHER_EXPORTER_MQTT_BROKERPORT=1883 | ||
- WEATHER_EXPORTER_MQTT_USERNAME=username | ||
- WEATHER_EXPORTER_MQTT_PASSWORD=password | ||
- WEATHER_EXPORTER_MQTT_CLIENTID=weather-exporter | ||
- WEATHER_EXPORTER_MQTT_TOPICPREFIX=weather | ||
ports: | ||
- "8080:8080" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters