6 Commits

4 changed files with 30 additions and 7 deletions

View File

@ -16,6 +16,7 @@ CIVICRM_DB_USER=civicrm
CIVICRM_DB_HOST=mysql
CIVICRM_DB_PORT=3306
WORDPRESS_ADMIN_EMAIL=
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_USER=wordpress
WORDPRESS_DB_HOST=mysql
@ -34,3 +35,4 @@ SECRET_DB_ROOT_PASSWORD_VERSION=v1
SECRET_CIVICRM_SITE_KEY_VERSION=v1 # length=16
SECRET_CIVICRM_CRED_KEY_VERSION=v1 # length=43
SECRET_CIVICRM_SIGN_KEY_VERSION=v1 # length=43
SECRET_WORDPRESS_ADMIN_PASSWORD_VERSION=v1

View File

@ -1,6 +1,6 @@
# civicrm
> One line description of the recipe
> CiviCRM Wordpress
<!-- metadata -->
@ -16,9 +16,21 @@
<!-- endmetadata -->
## Quick start
* `abra app new civicrm --secrets`
* `abra app new civicrm-wordpress`
* `abra app config <app-name>`
Generate secrets (be sure to save them):
* `abra app secret g mircivicrm2.coop.wiz.zone db_root_password v1 && \`
* `abra app secret g mircivicrm2.coop.wiz.zone db_password v1 && \`
* `abra app secret g mircivicrm2.coop.wiz.zone civicrm_site_key v1 && \`
* `abra app secret g mircivicrm2.coop.wiz.zone civicrm_cred_key v1 && \`
* `abra app secret g mircivicrm2.coop.wiz.zone civicrm_sign_key v1`
Insert secrets:
* `abra app secret i mircivicrm2.coop.wiz.zone wordpress_admin_password v1 '<temp account password>'`
* `abra app secret i mircivicrm2.coop.wiz.zone smtp_password v1 '<smtp password>'`
Deploy app:
* `abra app deploy <app-name>`
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).

View File

@ -3,7 +3,7 @@ version: "3.8"
services:
app:
image: michaelmcandrew/civicrm:5.59.4-wordpress-php8.1
image: michaelmcandrew/civicrm:5.80.0-wordpress-php8.1
hostname: civicrm
environment:
- PROJECT_NAME
@ -24,16 +24,18 @@ services:
- SMTP_PORT
- SMTP_USER
- SMTP_PASSWORD_FILE=/run/secrets/smtp_password
- WORDPRESS_ADMIN_PASSWORD_FILE=/run/secrets/wordpress_admin_password
secrets:
- db_password
- civicrm_site_key
- civicrm_cred_key
- civicrm_sign_key
- smtp_password
- wordpress_admin_password
volumes:
- data:/var/www/html/wp-content/uploads
networks:
- default
- internal
- proxy
configs:
- source: apache-sites-available-conf
@ -57,7 +59,7 @@ services:
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- "coop-cloud.${STACK_NAME}.version=0.1.1+5.59.4-wordpress-php8.1"
- "coop-cloud.${STACK_NAME}.version=0.1.2+5.80.0-wordpress-php8.1"
- "backupbot.backup=true"
- "backupbot.backup.path=/var/www/html/wp-content/uploads"
healthcheck:
@ -90,6 +92,8 @@ services:
timeout: 10s
retries: 10
start_period: 1m
networks:
- internal
deploy:
restart_policy:
condition: on-failure
@ -114,6 +118,7 @@ services:
networks:
proxy:
external: true
internal:
volumes:
mariadb:
@ -154,3 +159,6 @@ secrets:
civicrm_sign_key:
external: true
name: ${STACK_NAME}_civicrm_sign_key_${SECRET_CIVICRM_SIGN_KEY_VERSION}
wordpress_admin_password:
external: true
name: ${STACK_NAME}_wordpress_admin_password_${SECRET_WORDPRESS_ADMIN_PASSWORD_VERSION}

View File

@ -28,6 +28,7 @@ file_env "CIVICRM_DB_PASS"
file_env "CIVICRM_SITE_KEY"
file_env "CIVICRM_CRED_KEYS"
file_env "SMTP_PASSWORD"
file_env "WORDPRESS_ADMIN_PASSWORD"
if [[ "${1-default}" == "cron" ]]; then
echo "============ Running cron job ============"
@ -49,7 +50,7 @@ if su civicrm -c "wp core is-installed"; then
echo "============ Wordpress already installed ============"
else
echo "============ Installing Wordpress ============"
su civicrm -c "wp core install --locale=de_DE --url=$BASE_URL --title=$PROJECT_NAME --admin_user=admin --admin_email=$SMTP_USER"
su civicrm -c "wp core install --locale=de_DE --url=$BASE_URL --title=$PROJECT_NAME --admin_user=admin --admin_email=$WORDPRESS_ADMIN_EMAIL --admin_password='$WORDPRESS_ADMIN_PASSWORD'"
su civicrm -c "wp language core install de_DE"
su civicrm -c "wp language core activate de_DE"
fi