Fix: serversideup-konform - Port 8080, /etc/entrypoint.d/

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
This commit is contained in:
2025-12-17 13:06:07 +01:00
parent 11fc7cff27
commit 98258c5fd5
3 changed files with 14 additions and 37 deletions

View File

@@ -1,33 +1,26 @@
# WordPress Bedrock - Production # WordPress Bedrock - Production
# Basierend auf serversideup/php Dokumentation
FROM serversideup/php:8.4-fpm-nginx FROM serversideup/php:8.4-fpm-nginx
LABEL org.opencontainers.image.title="Kurs-Booking WordPress" LABEL org.opencontainers.image.title="Kurs-Booking WordPress"
LABEL org.opencontainers.image.vendor="webideas24" LABEL org.opencontainers.image.vendor="webideas24"
# Environment # Environment (serversideup spezifisch)
ENV WEB_DOCUMENT_ROOT=/var/www/html/web ENV WEB_DOCUMENT_ROOT=/var/www/html/web
ENV PHP_OPCACHE_ENABLE=1 ENV PHP_OPCACHE_ENABLE=1
ENV PHP_MEMORY_LIMIT=512M ENV PHP_MEMORY_LIMIT=512M
ENV PHP_UPLOAD_MAX_FILE_SIZE=64M ENV PHP_UPLOAD_MAX_FILESIZE=64M
ENV PHP_POST_MAX_SIZE=64M ENV PHP_POST_MAX_SIZE=64M
# Install dependencies + WP-CLI # Install WP-CLI (als root)
USER root USER root
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN curl -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
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 \
&& chmod +x /usr/local/bin/wp && chmod +x /usr/local/bin/wp
# Copy entrypoint script # Startup-Script in /etc/entrypoint.d/ (serversideup Standard)
COPY docker-entrypoint.sh /usr/local/bin/ COPY --chmod=755 entrypoint.d/ /etc/entrypoint.d/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Copy application (as www-data for composer) # Copy application
USER www-data USER www-data
WORKDIR /var/www/html WORKDIR /var/www/html
COPY --chown=www-data:www-data . . COPY --chown=www-data:www-data . .
@@ -35,13 +28,5 @@ COPY --chown=www-data:www-data . .
# Install Composer dependencies (production) # Install Composer dependencies (production)
RUN composer install --no-dev --optimize-autoloader --no-interaction RUN composer install --no-dev --optimize-autoloader --no-interaction
# Switch back to root for S6-overlay /init # serversideup verwendet Port 8080 (nicht 80!)
USER root EXPOSE 8080
# Kein eigener Health Check - Coolify/Traefik übernimmt das
HEALTHCHECK NONE
EXPOSE 80
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/init"]

View File

@@ -28,7 +28,7 @@ services:
networks: networks:
- internal - internal
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"] test: ["CMD", "curl", "-f", "http://localhost:8080/healthcheck"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
start_period: 60s start_period: 60s

View File

@@ -1,12 +1,9 @@
#!/bin/bash #!/bin/sh
# Erstellt .env aus Docker Environment Variables # Erstellt .env aus Docker Environment Variables
# Muss als root laufen (serversideup S6-overlay Requirement) # Numerisches Prefix 10- = frueh ausfuehren
set -e
ENV_FILE="/var/www/html/.env" ENV_FILE="/var/www/html/.env"
# .env aus Environment Variables erstellen
if [ ! -f "$ENV_FILE" ]; then if [ ! -f "$ENV_FILE" ]; then
cat > "$ENV_FILE" << EOF cat > "$ENV_FILE" << EOF
WP_ENV=${WP_ENV:-production} WP_ENV=${WP_ENV:-production}
@@ -26,10 +23,5 @@ SECURE_AUTH_SALT=${SECURE_AUTH_SALT}
LOGGED_IN_SALT=${LOGGED_IN_SALT} LOGGED_IN_SALT=${LOGGED_IN_SALT}
NONCE_SALT=${NONCE_SALT} NONCE_SALT=${NONCE_SALT}
EOF EOF
chown www-data:www-data "$ENV_FILE" echo "[entrypoint] .env created"
chmod 600 "$ENV_FILE"
echo "[entrypoint] .env created from environment variables"
fi fi
# S6-overlay /init ausführen (als root!)
exec "$@"