Add Containerfile
Add Containerfile and instructions how to use the provided container.
This commit is contained in:
parent
366a50cc84
commit
628eb6f231
14
Containerfile
Normal file
14
Containerfile
Normal 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"]
|
3
Makefile
3
Makefile
|
@ -8,5 +8,8 @@ install: all
|
|||
meteod: cmd/meteod/*.go
|
||||
go build -o $@ $^
|
||||
|
||||
container: meteod
|
||||
podman build . -t codeberg.org/grisu48/meteo
|
||||
|
||||
## === Tests ================================================================ ##
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue