-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(service): add WordPress OpenLiteSpeed service template #8271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # documentation: https://wordpress.org | ||
| # slogan: WordPress is open source software you can use to create a beautiful website, blog, or app. | ||
| # category: cms | ||
| # tags: cms, blog, content, management, mariadb, openlitespeed | ||
| # logo: svgs/wordpress.svg | ||
|
|
||
| services: | ||
| wordpress: | ||
| image: litespeedtech/openlitespeed:latest | ||
| volumes: | ||
| - wordpress-files:/var/www/vhosts/localhost/html | ||
| environment: | ||
| - SERVICE_URL_WORDPRESS | ||
| - WORDPRESS_DB_HOST=mariadb | ||
| - WORDPRESS_DB_USER=$SERVICE_USER_WORDPRESS | ||
| - WORDPRESS_DB_PASSWORD=$SERVICE_PASSWORD_WORDPRESS | ||
| - WORDPRESS_DB_NAME=wordpress | ||
| depends_on: | ||
| - mariadb | ||
| entrypoint: ["/bin/sh", "-c"] | ||
| command: | | ||
| set -e | ||
| DOCROOT="/var/www/vhosts/localhost/html" | ||
| if [ ! -f "$${DOCROOT}/wp-config.php" ]; then | ||
| mkdir -p "$${DOCROOT}" | ||
| curl -sL https://wordpress.org/latest.tar.gz | tar -xz -C /tmp | ||
| cp -R /tmp/wordpress/. "$${DOCROOT}" | ||
| rm -rf /tmp/wordpress | ||
| wp config create --path="$${DOCROOT}" --dbname="$${WORDPRESS_DB_NAME}" --dbuser="$${WORDPRESS_DB_USER}" --dbpass="$${WORDPRESS_DB_PASSWORD}" --dbhost="$${WORDPRESS_DB_HOST}" --skip-check --allow-root | ||
| chown -R 1000:1000 "$${DOCROOT}" | ||
|
Comment on lines
+24
to
+30
|
||
| fi | ||
| exec /entrypoint.sh | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://127.0.0.1"] | ||
| interval: 2s | ||
| timeout: 10s | ||
| retries: 10 | ||
| mariadb: | ||
| image: mariadb:11 | ||
| volumes: | ||
| - mariadb-data:/var/lib/mysql | ||
| environment: | ||
| - MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_ROOT | ||
| - MYSQL_DATABASE=wordpress | ||
| - MYSQL_USER=$SERVICE_USER_WORDPRESS | ||
| - MYSQL_PASSWORD=$SERVICE_PASSWORD_WORDPRESS | ||
| healthcheck: | ||
| test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] | ||
| interval: 5s | ||
| timeout: 20s | ||
| retries: 10 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The container downloads and unpacks WordPress at runtime from
https://wordpress.org/latest.tar.gz. This adds an external availability dependency to every fresh deployment and makes installs non-reproducible as “latest” changes over time. Consider using a prebuilt image that already contains WordPress (or pinning to a specific WordPress version and validating the download, e.g., checksum/signature) to improve reliability.