diff --git a/Dockerfile b/Dockerfile index 07bb5b9..b8d345e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,54 @@ LABEL org.opencontainers.image.title="${APP_NAME}" ENV TZ=${TZ} ENV USER=${APP_USER} -RUN apk add --no-cache tzdata ca-certificates +RUN apt-get update && apt-get install -y \ + nginx \ + php7.4-fpm \ + php7.4-cli \ + php7.4-mysql \ + php7.4-xml \ + php7.4-curl \ + php7.4-gd \ + php7.4-mbstring \ + php7.4-json \ + git \ + tmux \ + curl \ + unzip \ + && rm -rf /var/lib/apt/lists/* -WORKDIR /app -COPY ./config /app/config -COPY ./data /app/data +# nZEDb in das Web-Verzeichnis klonen +RUN git clone https://github.com/nZEDb/nZEDb.git /var/www/nZEDb -RUN adduser -D ${APP_USER} && chown -R ${APP_USER}:${APP_USER} /app +WORKDIR /var/www/nZEDb -USER ${APP_USER} +# ===================================================================== +# AUTOMATISCHE PATCHES (Updatesicher ins Image eingebrannt) +# ===================================================================== -CMD ["sh"] \ No newline at end of file +# 1. Systemweiten Git-Sicherheits-Fix setzen +RUN git config --system --add safe.directory /var/www/nZEDb + +# 2. Zeitzonen-Fehler in der DB.php patchen +RUN sed -i 's/\$result = \$this->queryDirect("SET time_zone = .*/\$result = true;/g' /var/www/nZEDb/nzedb/db/DB.php + +# 3. Zeitzonen-Fehler im Lithium-Framework (MySql.php) patchen +RUN sed -i 's/function timezone\(.*\){/function timezone\1{ return;/g' /var/www/nZEDb/app/extensions/adapter/data/source/database/MySql.php \ + && sed -i '/function timezone/!b;n;s/{/{ return;/' /var/www/nZEDb/app/extensions/adapter/data/source/database/MySql.php + +# ===================================================================== + +# Nginx-Konfiguration austauschen +COPY nginx-default.conf /etc/nginx/sites-enabled/default + +# Start-Skript einbinden und ausführbar machen +COPY start.sh /start.sh +RUN chmod +x /start.sh + +# Arbeitsverzeichnis definieren (deckt sich mit deinem Inspect) +WORKDIR /var/www/nZEDb + +# Port nach außen freigeben (wird via Compose auf 8800 gemappt) +EXPOSE 80 + +CMD ["/start.sh"] \ No newline at end of file