ci: add ci and docker files
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed

This commit is contained in:
Radical 2025-05-05 13:11:07 +02:00
parent f37280c3f6
commit dc3fd58c72
3 changed files with 62 additions and 0 deletions

26
entrypoint.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/sh
if [ ! -d "/web/logs" ]; then
mkdir /web/logs
fi
rotate_log() {
LOGFILE="$1"
BASENAME=$(basename "$LOGFILE" .log)
DIRNAME=$(dirname "$LOGFILE")
if [ -f "$LOGFILE" ]; then
# Find the next available number
i=1
while [ -f "$DIRNAME/${BASENAME}.${i}.log.gz" ]; do
i=$((i + 1))
done
gzip "$LOGFILE"
mv "${LOGFILE}.gz" "$DIRNAME/${BASENAME}.${i}.log.gz"
fi
}
rotate_log "/web/logs/frontend.log"
/usr/bin/node /web/server/index.mjs 2>&1 | tee /gorb/logs/frontend.log