diff --git a/Dockerfile b/Dockerfile index 51b5990..e0ccb42 100644 --- a/Dockerfile +++ b/Dockerfile @@ -124,6 +124,9 @@ RUN sed -i "s/user = nobody/user = phpbb/g" /etc/php${PHP_VERSION}/php-fpm.d/www COPY scripts/install-phpbb.sh scripts/docker-entrypoint.sh scripts/install-from-yml.sh /opt/.docker/ COPY config/nginx.conf /etc/nginx/http.d/default.conf +# Copy phpbb artefact fixed version +COPY artefacts/phpbb.zip /tmp/phpbb.zip + # Download and install phpBB during the build RUN if [ -z "${PHPBB_VERSION}" ]; then \ echo "ERROR: PHPBB_VERSION build argument is not set" && exit 1; \ @@ -135,10 +138,10 @@ RUN if [ -z "${PHPBB_VERSION}" ]; then \ echo "ERROR: Could not extract major.minor version from ${PHPBB_VERSION}" && exit 1; \ fi && \ # Download and extract phpBB - DOWNLOAD_URL="https://download.phpbb.com/pub/release/${MAJOR_MINOR_VERSION}/${PHPBB_VERSION}/phpBB-${PHPBB_VERSION}.zip" && \ - echo "Downloading from: ${DOWNLOAD_URL}" && \ + # DOWNLOAD_URL="https://download.phpbb.com/pub/release/${MAJOR_MINOR_VERSION}/${PHPBB_VERSION}/phpBB-${PHPBB_VERSION}.zip" && \ + # echo "Downloading from: ${DOWNLOAD_URL}" && \ cd /tmp && \ - curl -L -o phpbb.zip "${DOWNLOAD_URL}" && \ + # curl -L -o phpbb.zip "${DOWNLOAD_URL}" && \ unzip phpbb.zip && \ rm phpbb.zip && \ # Move files to destination and set up directories diff --git a/artefacts/phpBB-3.3.15.zip b/artefacts/phpBB-3.3.15.zip new file mode 100644 index 0000000..174a1cb Binary files /dev/null and b/artefacts/phpBB-3.3.15.zip differ diff --git a/artefacts/phpbb.zip b/artefacts/phpbb.zip new file mode 120000 index 0000000..bf7ed27 --- /dev/null +++ b/artefacts/phpbb.zip @@ -0,0 +1 @@ +phpBB-3.3.15.zip \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index 3c6e818..766597d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -69,7 +69,7 @@ PATCH_VERSION=$VERSION log "Version components: Major=$MAJOR_VERSION, Minor=$MINOR_VERSION, Patch=$PATCH_VERSION" # Set image name base -DOCKER_IMAGE=${DOCKER_IMAGE:-"evandarwin/phpbb"} +DOCKER_IMAGE=${DOCKER_IMAGE:-"basbe/phpbb"} # Build the Docker image with PHP 8.4 log "==> Building phpBB Docker image" @@ -81,21 +81,25 @@ log " image name :: $DOCKER_IMAGE:$VERSION" # Set build args BUILD_ARGS="--build-arg PHPBB_VERSION=$VERSION --build-arg PHP_VERSION=84 --build-arg ALPINE_VERSION=edge" +# Enable buildx +docker buildx create --use +docker buildx inspect --bootstrap + # Build the Docker image -docker build \ +docker buildx build --platform linux/amd64,linux/arm64 \ $BUILD_ARGS \ -t "$DOCKER_IMAGE:$VERSION" \ - . + . --push # Create additional version tags -docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:$MINOR_VERSION" -log "Tagged $VERSION as $MINOR_VERSION" +# docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:$MINOR_VERSION" +# log "Tagged $VERSION as $MINOR_VERSION" -docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:$MAJOR_VERSION" -log "Tagged $VERSION as $MAJOR_VERSION" +# docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:$MAJOR_VERSION" +# log "Tagged $VERSION as $MAJOR_VERSION" -docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:latest" -log "Tagged $VERSION as latest" +# docker tag "$DOCKER_IMAGE:$VERSION" "$DOCKER_IMAGE:latest" +# log "Tagged $VERSION as latest" log "==> Build complete!" diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index f04e4fb..3cb68ed 100755 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -199,17 +199,17 @@ check_database_connectivity() { fi # Try connecting to MySQL with appropriate arguments - if command -v mysql >/dev/null 2>&1; then - log "Testing MySQL connection to $db_host..." - if ! mysql -h "$db_host" ${db_port:+-P "$db_port"} -u "$db_user" ${db_pass:+-p"$db_pass"} -e "SELECT 1" >/dev/null 2>&1; then - log "WARNING: Could not connect to MySQL server at $db_host. phpBB may not function correctly!" - result=0 # Don't fail the container, just warn - else - log "MySQL connectivity test successful" - fi - else - log "WARNING: MySQL client not available, skipping connectivity check" - fi + # if command -v mysql >/dev/null 2>&1; then + # log "Testing MySQL connection to $db_host..." + # if ! mysql -h "$db_host" ${db_port:+-P "$db_port"} -u "$db_user" ${db_pass:+-p"$db_pass"} -e "SELECT 1" >/dev/null 2>&1; then + # log "WARNING: Could not connect to MySQL server at $db_host. phpBB may not function correctly!" + # result=0 # Don't fail the container, just warn + # else + # log "MySQL connectivity test successful" + # fi + # else + # log "WARNING: MySQL client not available, skipping connectivity check" + # fi ;; postgres) diff --git a/scripts/install-from-yml.sh b/scripts/install-from-yml.sh index 66d7719..4e38a17 100755 --- a/scripts/install-from-yml.sh +++ b/scripts/install-from-yml.sh @@ -92,25 +92,27 @@ test_db_connection() { case "$driver" in mysqli) - # Set default MySQL port if not specified - [ -z "$port" ] && port="3306" + # # Set default MySQL port if not specified + # [ -z "$port" ] && port="3306" - if command -v mysql > /dev/null 2>&1; then - log "Testing MySQL connection to $host:$port..." - if ! mysql -h "$host" -P "$port" -u "$user" ${pass:+-p"$pass"} -e "SELECT 1" > /dev/null 2>&1; then - log "ERROR: Failed to connect to MySQL database" - return 1 - fi + # if command -v mysql > /dev/null 2>&1; then + # log "Testing MySQL connection to $host:$port..." + # echo "mysql -h $host -P $port -u $user --password=$pass $name" + # #if ! mysql -h "$host" -P "$port" -u "$user" ${pass:+-p"$pass"} -e "SELECT 1" > /dev/null 2>&1; then + # if ! mysql -h "$host" -P "$port" -u "$user" --password="$pass" "$name" -e "SELECT 1" > /dev/null 2>&1; then + # log "ERROR: Failed to connect to MySQL database" + # return 1 + # fi - # Test if database exists or we can create it - if ! mysql -h "$host" -P "$port" -u "$user" ${pass:+-p"$pass"} -e "USE \`$name\`" > /dev/null 2>&1; then - log "Database '$name' doesn't exist, will be created during installation" - fi + # # Test if database exists or we can create it + # if ! mysql -h "$host" -P "$port" -u "$user" ${pass:+-p"$pass"} -e "USE \`$name\`" > /dev/null 2>&1; then + # log "Database '$name' doesn't exist, will be created during installation" + # fi - log "MySQL connection successful" - else - log "WARNING: mysql client not found, skipping connection test" - fi + # log "MySQL connection successful" + # else + # log "WARNING: mysql client not found, skipping connection test" + # fi ;; postgres)