diff --git a/build-images.sh b/build-images.sh index f1cb647..6130ac4 100644 --- a/build-images.sh +++ b/build-images.sh @@ -12,12 +12,26 @@ set -e images=() # The image will be pushed to GitHub container registry repobase="${REPOBASE:-ghcr.io/nethserver}" +wordpress_version="6.4.3-php8.3-apache" +#Create webtop-webapp container +reponame="wordpress-app" +container=$(buildah from docker.io/wordpress:${wordpress_version}) +buildah run "${container}" /bin/sh <<'EOF' +set -e +docker-php-ext-install pdo_mysql +EOF +# Commit the image +buildah commit --rm "${container}" "${repobase}/${reponame}" + +# Append the image URL to the images array +images+=("${repobase}/${reponame}") + + # Configure the image name reponame="wordpress" # Create a new empty container image container=$(buildah from scratch) - # Reuse existing nodebuilder-wordpress container, to speed up builds if ! buildah containers --format "{{.ContainerName}}" | grep -q nodebuilder-wordpress; then echo "Pulling NodeJS runtime..." @@ -45,7 +59,7 @@ buildah config --entrypoint=/ \ --label="org.nethserver.authorizations=traefik@node:routeadm" \ --label="org.nethserver.tcp-ports-demand=3" \ --label="org.nethserver.rootfull=0" \ - --label="org.nethserver.images=docker.io/mariadb:10.11.5 docker.io/wordpress:6.4.3-php8.3-apache" \ + --label="org.nethserver.images=docker.io/mariadb:10.11.5 ${repobase}/wordpress-app:${IMAGETAG:-latest}" \ "${container}" # Commit the image buildah commit "${container}" "${repobase}/${reponame}" diff --git a/imageroot/systemd/user/wordpress-app.service b/imageroot/systemd/user/wordpress-app.service index 49d33f1..4e47c85 100644 --- a/imageroot/systemd/user/wordpress-app.service +++ b/imageroot/systemd/user/wordpress-app.service @@ -39,7 +39,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/wordpress-app.pid \ --env WORDPRESS_SECURE_AUTH_SALT="${SECRET}" \ --env WORDPRESS_LOGGED_IN_SALT="${SECRET}" \ --env WORDPRESS_NONCE_SALT="${SECRET}" \ - ${WORDPRESS_IMAGE} + ${WORDPRESS_APP_IMAGE} ExecStop=/usr/bin/podman stop --ignore --cidfile %t/wordpress-app.ctr-id -t 10 ExecReload=/usr/bin/podman kill -s HUP wordpress-app SyslogIdentifier=%u