Add Containerfile

Add Containerfile and instructions how to use the provided container.
This commit is contained in:
Felix Niederwanger 2023-02-01 16:47:54 +01:00
parent 366a50cc84
commit 628eb6f231
Signed by: phoenix
GPG key ID: 31860289A704FB3C
3 changed files with 25 additions and 0 deletions

14
Containerfile Normal file
View file

@ -0,0 +1,14 @@
FROM golang:alpine AS builder
WORKDIR /app
ADD . /app
RUN apk update && apk add build-base
RUN cd /app && CGO_ENABLED=0 go build -ldflags="-w -s" -o meteod ./...
FROM scratch
WORKDIR /app
COPY --from=builder /app/meteod /meteod
VOLUME "/conf"
ENTRYPOINT ["/meteod"]
CMD ["-c", "/conf/meteod.conf"]

View file

@ -8,5 +8,8 @@ install: all
meteod: cmd/meteod/*.go
go build -o $@ $^
container: meteod
podman build . -t codeberg.org/grisu48/meteo
## === Tests ================================================================ ##

View file

@ -59,3 +59,11 @@ OPTIONS
--token TOKEN Set influxdb token
--http BINDADDR Enable http server on the given address
```
## container image
You can run `meteod` as container image from codeberg.org. Create a [meteod.conf](meteod.conf.example) configuration file, and run the container in the container engine of your choise:
podman run --name meteo -v /path/to/your/meteod.conf:/conf/meteod.conf -p 4042:4042 codeberg.org/grisu48/meteo
That's it!