diff --git a/.env.sample b/.env.sample index c659d90..1491138 100644 --- a/.env.sample +++ b/.env.sample @@ -18,6 +18,5 @@ LETS_ENCRYPT_ENV=production #MAIL_OPTIONS_AUTH_USER=smtpuser@example.com ## Matrix-Synapse-Redirection -# If you want to use Ghost on a TLD which you want to use as matrix server name as well # COMPOSE_FILE="$COMPOSE_FILE:compose.matrix.yml" # MATRIX_DOMAIN=matrix-synapse.example.com \ No newline at end of file diff --git a/README.md b/README.md index 884f441..fe78550 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # ghost -Headless Node.js CMS for professional publishing +Node.js CMS for professional publishing (headless possible). * **Category**: Apps -* **Status**: -* **Image**: -* **Healthcheck**: -* **Backups**: -* **Email**: Y -* **Tests**: -* **SSO**: +* **Status**: 3, stable +* **Image**: [`ghost`](https://hub.docker.com/_/ghost), 4, upstream +* **Healthcheck**: Yes +* **Backups**: Yes +* **Email**: Yes +* **Tests**: No +* **SSO**: N/A @@ -28,3 +28,8 @@ Headless Node.js CMS for professional publishing [`abra`]: https://git.coopcloud.tech/coop-cloud/abra [`coop-cloud/traefik`]: https://git.coopcloud.tech/coop-cloud/traefik + + +## Further configuration +### Matrix-Synapse configuration +If you want to use Ghost on a top-level-domain which you want to use as matrix server name as well, just uncomment the respective section in `YOURAPPDOMAIN.env` and insert your `MATRIX_DOMAIN` \ No newline at end of file diff --git a/compose.yml b/compose.yml index bb6d161..c3bc8f8 100644 --- a/compose.yml +++ b/compose.yml @@ -8,6 +8,7 @@ services: database__connection__user: root database__connection__database: ghost database__connection__password_FILE: /run/secrets/db_password + # database__connection__password_FILE: /run/secrets/db_password url: https://$DOMAIN mail__transport: ${MAIL_TRANSPORT} mail__from: ${MAIL_FROM} @@ -25,8 +26,10 @@ services: - source: ghost_entrypoint target: /abra-entrypoint.sh mode: 0555 - command: node current/index.js + command: ["node", "current/index.js"] entrypoint: /abra-entrypoint.sh + depends_on: + - db networks: - proxy - backend @@ -48,12 +51,12 @@ services: - "backupbot.backup=true" - "backupbot.backup.path=/var/lib/ghost/content" - "coop-cloud.${STACK_NAME}.version=0.1.0+5-alpine" - # healthcheck: - # test: ["CMD", "curl", "-f", "http://localhost"] - # interval: 30s - # timeout: 10s - # retries: 10 - # start_period: 1m + healthcheck: + test: ["CMD", "wget", "--header=X-Forwarded-Proto: https", "--spider", "-q", "http://localhost:2368/ghost/api/admin/site"] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m db: image: mysql:8.0 @@ -68,10 +71,17 @@ services: deploy: labels: - "backupbot.backup=true" - - "backupbot.backup.pre-hook=mysqldump -u root -pghost ghost --tab /var/lib/mysql-files/" + - "backupbot.backup.pre-hook=mysqldump -u root -p\"$$(cat /run/secrets/db_password)\" ghost --tab /var/lib/mysql-files/" - "backupbot.backup.post-hook=rm -rf /var/lib/mysql-files/*" - "backupbot.backup.path=/var/lib/mysql-files/" + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p\"$$(cat /run/secrets/db_password)\""] + interval: 30s + timeout: 10s + retries: 10 + start_period: 1m + networks: proxy: external: true diff --git a/entrypoint.sh b/entrypoint.sh index b14276d..007eaff 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -29,4 +29,4 @@ file_env "database__connection__password" file_env "mail__options__auth__pass" # upstream entrypoint https://github.com/docker-library/ghost/blob/master/5/alpine/Dockerfile -/usr/local/bin/docker-entrypoint.sh "$@" \ No newline at end of file +exec /usr/local/bin/docker-entrypoint.sh "$@" \ No newline at end of file diff --git a/release/1.0.0+5-alpine.txt b/release/1.0.0+5-alpine.txt index 4579e22..1749275 100644 --- a/release/1.0.0+5-alpine.txt +++ b/release/1.0.0+5-alpine.txt @@ -1,4 +1,14 @@ # Attention!!! +There are two things you need to change manually: +1. insert secrets for mysql database and smtp +2. migrate your MySQL database from 5.7 to 8.0 + +## 1. insert secret +The recipe now includes two secrets: `db_password` and `smtp_password` make sure you change them. +To not break somthing, just insert `ghost` as `db_password` because this was the hard coded password before. +If desired to change the db-password, I recommend to do try it after migrating as I run in some difficult to debug problems doing this. + +## 2. migrate your MySQL database from 5.7 to 8.0 Recipe updates MySQL version from 5.7 to 8.0 as it is the only supported version of ghost: https://ghost.org/docs/faq/supported-databases/ @@ -38,4 +48,7 @@ abra app run ghost.dev.local-it.cloud db -t -- mysql -u root -pghost ghost -B -- echo "SET foreign_key_checks=1;" >> ~/.abra/backups/"$APP_URL"_alter_table.sql # run these alter_table.sql commands -abra app run "$APP_URL" db -t -- mysql -u root -pghost ghost < ~/.abra/backups/"$APP_URL"_alter_table.sql \ No newline at end of file +abra app run "$APP_URL" db -t -- mysql -u root -pghost ghost < ~/.abra/backups/"$APP_URL"_alter_table.sql + + +