diff --git a/redis/5/Dockerfile b/redis/5/Dockerfile deleted file mode 100644 index aab5eff02..000000000 --- a/redis/5/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# ---------------------------------- -# Environment: redis -# ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:5-bullseye - -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt -y update && \ - apt -y upgrade && \ - apt -y install iproute2 && \ - useradd -d /home/container -m container -s /bin/bash - -USER container -ENV USER=container HOME=/home/container -WORKDIR /home/container - -COPY ../entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/redis/6/Dockerfile b/redis/6/Dockerfile deleted file mode 100644 index e8a95e5de..000000000 --- a/redis/6/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -# ---------------------------------- -# Environment: redis -# ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:6-bookworm - -LABEL author="Michael Parker" maintainer="parker@pterodactyl.io" - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt -y update && \ - apt -y upgrade && \ - apt -y install iproute2 && \ - useradd -d /home/container -m container -s /bin/bash - -USER container -ENV USER=container HOME=/home/container -WORKDIR /home/container - -COPY ../entrypoint.sh /entrypoint.sh -CMD ["/bin/bash", "/entrypoint.sh"] diff --git a/redis/8/Dockerfile b/redis/8/Dockerfile index 6b5c06f82..204558ca8 100644 --- a/redis/8/Dockerfile +++ b/redis/8/Dockerfile @@ -1,7 +1,7 @@ # ---------------------------------- # Environment: redis # ---------------------------------- -FROM --platform=$TARGETOS/$TARGETARCH redis:8-bookworm +FROM --platform=$TARGETOS/$TARGETARCH redis:8-trixie ENV DEBIAN_FRONTEND=noninteractive diff --git a/redis/entrypoint.sh b/redis/entrypoint.sh index 6e19f17ac..5ad62f1a1 100644 --- a/redis/entrypoint.sh +++ b/redis/entrypoint.sh @@ -1,13 +1,29 @@ #!/bin/bash cd /home/container -# Make internal Docker IP address available to processes. INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') export INTERNAL_IP -# Replace Startup Variables MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') echo ":/home/container$ ${MODIFIED_STARTUP}" -# Run the Server -eval ${MODIFIED_STARTUP} +eval ${MODIFIED_STARTUP} & +REDIS_PID=$! + +for i in $(seq 1 60); do + if /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning PING 2>/dev/null | grep -q PONG; then + break + fi + sleep 0.5 +done + +( + while IFS= read -r line; do + [ -z "$line" ] && continue + printf '%s\n' "$line" | /usr/local/bin/redis-cli -p "${SERVER_PORT}" -a "${SERVER_PASSWORD}" --no-auth-warning + done +) < /dev/stdin & +READER_PID=$! + +wait $REDIS_PID +kill $READER_PID 2>/dev/null \ No newline at end of file