Archived
3
0

extract config to external files
Some checks failed
Check indentation / build (push) Has been cancelled
Continuous testing / build (push) Has been cancelled

This commit is contained in:
2025-03-12 23:08:40 +01:00
parent 975ebedace
commit 5513042b1b
10 changed files with 193 additions and 46 deletions

View File

@@ -2,6 +2,7 @@ FROM docker.io/alpine:latest
COPY ./zmp24 /usr/bin/zmp24
COPY ./run.sh /run.sh
RUN apk update && apk add gcompat && mkdir /data
RUN apk update && apk add gcompat && mkdir /data && mkdir /default
COPY ./config.toml /default/config.toml
CMD [ "/run.sh" ]

View File

@@ -1,10 +1,10 @@
.PHONY: image
image: dst/image/zmp24 dst/image/Containerfile dst/image/run.sh config.json
image: dst/image/zmp24 dst/image/Containerfile dst/image/run.sh dst/image/config.toml config.json
cd dst/image && podman build . -t \
"$$(jq -r .image.name ../../config.json):$$(jq -r .image.version ../../config.json)"
dst/image: dst
mkdir dst/image
mkdir -p dst/image
dst/image/Containerfile: dst/image image/image.dockerfile
ln -sf $$(pwd)/image/image.dockerfile dst/image/Containerfile
@@ -13,5 +13,8 @@ dst/image/run.sh: dst/image image/run.sh
ln -f image/run.sh dst/image/run.sh
chmod +x dst/image/run.sh
dst/image/config.toml: dst/image dst/prod_config.toml
ln -f dst/prod_config.toml dst/image/config.toml
dst/image/zmp24: dst/image target/$(ARCH)-unknown-linux-musl/release/zmp24
ln -f target/$(ARCH)-unknown-linux-musl/release/zmp24 dst/image/zmp24

View File

@@ -1,10 +1,15 @@
#!/bin/sh
if [ ! -f /data/config.toml ]
then
cp /default/config.toml /data/config.toml
fi
_term() {
kill -TERM "$server_pid" 2>/dev/null
}
trap _term SIGTERM
/usr/bin/zmp24 &
/usr/bin/zmp24 /data/config.toml &
server_pid=$!
wait "$server_pid"