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:
35
Dockerfile
35
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user