Skip to content

Commit

Permalink
Merge pull request #6 from NethServer/pdoMysql
Browse files Browse the repository at this point in the history
Add WordPress app container and install pdo_mysql
  • Loading branch information
stephdl authored Mar 12, 2024
2 parents 5c3f27d + ed00079 commit 9bb5963
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion imageroot/systemd/user/wordpress-app.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bb5963

Please sign in to comment.