From 98258c5fd5e1d783807b58d013df84e6997b1131 Mon Sep 17 00:00:00 2001 From: Joseph Kisler Date: Wed, 17 Dec 2025 13:06:07 +0100 Subject: [PATCH] Fix: serversideup-konform - Port 8080, /etc/entrypoint.d/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nach Dokumentation recherchiert: - Kein ENTRYPOINT override (serversideup hat eigenen) - Scripts nach /etc/entrypoint.d/ mit 755 - Port 8080 statt 80 - Healthcheck auf /healthcheck Endpoint - USER www-data am Ende (serversideup Standard) Quelle: serversideup.net/open-source/docker-php/docs 🤖 Generated with Claude Code --- Dockerfile | 35 ++++++------------- docker-compose.yaml | 2 +- .../10-create-env.sh | 14 ++------ 3 files changed, 14 insertions(+), 37 deletions(-) rename docker-entrypoint.sh => entrypoint.d/10-create-env.sh (62%) diff --git a/Dockerfile b/Dockerfile index c797f23..aa1cfe9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,26 @@ # WordPress Bedrock - Production +# Basierend auf serversideup/php Dokumentation FROM serversideup/php:8.4-fpm-nginx LABEL org.opencontainers.image.title="Kurs-Booking WordPress" LABEL org.opencontainers.image.vendor="webideas24" -# Environment +# Environment (serversideup spezifisch) ENV WEB_DOCUMENT_ROOT=/var/www/html/web ENV PHP_OPCACHE_ENABLE=1 ENV PHP_MEMORY_LIMIT=512M -ENV PHP_UPLOAD_MAX_FILE_SIZE=64M +ENV PHP_UPLOAD_MAX_FILESIZE=64M ENV PHP_POST_MAX_SIZE=64M -# Install dependencies + WP-CLI +# Install WP-CLI (als root) USER root -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - unzip \ - curl \ - less \ - mariadb-client \ - && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ +RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \ && chmod +x /usr/local/bin/wp -# Copy entrypoint script -COPY docker-entrypoint.sh /usr/local/bin/ -RUN chmod +x /usr/local/bin/docker-entrypoint.sh +# Startup-Script in /etc/entrypoint.d/ (serversideup Standard) +COPY --chmod=755 entrypoint.d/ /etc/entrypoint.d/ -# Copy application (as www-data for composer) +# Copy application USER www-data WORKDIR /var/www/html COPY --chown=www-data:www-data . . @@ -35,13 +28,5 @@ COPY --chown=www-data:www-data . . # Install Composer dependencies (production) RUN composer install --no-dev --optimize-autoloader --no-interaction -# Switch back to root for S6-overlay /init -USER root - -# Kein eigener Health Check - Coolify/Traefik übernimmt das -HEALTHCHECK NONE - -EXPOSE 80 - -ENTRYPOINT ["docker-entrypoint.sh"] -CMD ["/init"] +# serversideup verwendet Port 8080 (nicht 80!) +EXPOSE 8080 diff --git a/docker-compose.yaml b/docker-compose.yaml index dba539b..c0cd225 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -28,7 +28,7 @@ services: networks: - internal healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:80/"] + test: ["CMD", "curl", "-f", "http://localhost:8080/healthcheck"] interval: 30s timeout: 10s start_period: 60s diff --git a/docker-entrypoint.sh b/entrypoint.d/10-create-env.sh similarity index 62% rename from docker-entrypoint.sh rename to entrypoint.d/10-create-env.sh index f7c8841..1641825 100644 --- a/docker-entrypoint.sh +++ b/entrypoint.d/10-create-env.sh @@ -1,12 +1,9 @@ -#!/bin/bash +#!/bin/sh # Erstellt .env aus Docker Environment Variables -# Muss als root laufen (serversideup S6-overlay Requirement) - -set -e +# Numerisches Prefix 10- = frueh ausfuehren ENV_FILE="/var/www/html/.env" -# .env aus Environment Variables erstellen if [ ! -f "$ENV_FILE" ]; then cat > "$ENV_FILE" << EOF WP_ENV=${WP_ENV:-production} @@ -26,10 +23,5 @@ SECURE_AUTH_SALT=${SECURE_AUTH_SALT} LOGGED_IN_SALT=${LOGGED_IN_SALT} NONCE_SALT=${NONCE_SALT} EOF - chown www-data:www-data "$ENV_FILE" - chmod 600 "$ENV_FILE" - echo "[entrypoint] .env created from environment variables" + echo "[entrypoint] .env created" fi - -# S6-overlay /init ausführen (als root!) -exec "$@"