Apply suggestions from code review

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L.
2026-04-24 16:26:57 +02:00
parent f80f888d6c
commit 47307b37f8
7 changed files with 21 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:latest
FROM golang:1.26.2-alpine3.23 AS go
ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee
ENV IMAGINARY_HASH=6a274b488759a896aff02f52afee6e50b5e3a3ee
RUN set -ex; \
apk upgrade --no-cache -a; \
@@ -33,7 +33,8 @@ COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
COPY --chmod=775 start.sh /start.sh
COPY --chmod=775 healthcheck.sh /healthcheck.sh
ENV PORT=9000
ENV PORT=9000 \
AIO_LOG_LEVEL=warn
USER 65534

View File

@@ -4,15 +4,15 @@ if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
set -x
fi
if [ "$AIO_LOG_LEVEL" = 'debug' ]; then
GOLANG_LOG="$(case "$AIO_LOG_LEVEL" in
debug) printf 'info' ;;
info) printf 'info' ;;
warn) printf 'warning' ;;
error) printf 'error' ;;
esac)"
export GOLANG_LOG
if [ "$AIO_LOG_LEVEL" = "debug" ]; then
export DEBUG='*'
export GOLANG_LOG='info'
elif [ "$AIO_LOG_LEVEL" = 'info' ]; then
export GOLANG_LOG='info'
elif [ "$AIO_LOG_LEVEL" = 'warn' ]; then
export GOLANG_LOG='warning'
else
export GOLANG_LOG='error'
fi
echo "Imaginary has started"