feat(discourse): switch app to official discourse/discourse image (experimental)
All checks were successful
cc-ci/testme cc-ci: success

Replaces the paywalled bitnamilegacy app with the official discourse/discourse
image behind Traefik. DB is reused as-is; uploads migrate from the legacy
bitnami volume idempotently. The wrapper entrypoint injects the db_password and
smtp_password secrets (the official image has no *_FILE support). SMTP env vars
are renamed to the official names; release notes cover the migration.

Recipe 0.8.1+3.5.0 -> 1.0.0+3.5.3 (major: new image, env/volume/port changes).
This commit is contained in:
notplants
2026-06-18 21:58:13 +00:00
parent f87c612d71
commit 0c4539b7ad
9 changed files with 170 additions and 117 deletions

View File

@ -3,53 +3,64 @@ version: "3.8"
services:
app:
image: bitnamilegacy/discourse:3.5.0
image: discourse/discourse:3.5.3
networks:
- proxy
- internal
# entrypoint: ['tail', '-f', '/dev/null']
# official image CMD is /sbin/boot; wrapper injects the DB password secret first
entrypoint: /usr/local/bin/cc-app-entrypoint.sh
environment:
- ALLOW_EMPTY_PASSWORD=yes
- DISCOURSE_DATABASE_HOST=${STACK_NAME}_db
- DISCOURSE_DATABASE_NAME=discourse
- DISCOURSE_DATABASE_PASSWORD_FILE=/run/secrets/db_password
- DISCOURSE_DATABASE_USER=discourse
- DISCOURSE_HOST=${DOMAIN}
- DISCOURSE_NOTIFICATION_EMAIL
- DISCOURSE_SMTP_AUTH
- DISCOURSE_SMTP_HOST
- DISCOURSE_HOSTNAME=${DOMAIN}
- DISCOURSE_DEVELOPER_EMAILS=${DISCOURSE_DEVELOPER_EMAILS}
- DISCOURSE_DB_HOST=${STACK_NAME}_db
- DISCOURSE_DB_PORT=5432
- DISCOURSE_DB_NAME=discourse
- DISCOURSE_DB_USERNAME=discourse
- DISCOURSE_REDIS_HOST=${STACK_NAME}_redis
- DISCOURSE_REDIS_PORT=6379
- DISCOURSE_SMTP_ADDRESS
- DISCOURSE_SMTP_PORT
- DISCOURSE_SMTP_PROTOCOL
- DISCOURSE_SMTP_USER
- PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0
- DISCOURSE_SMTP_USER_NAME
- DISCOURSE_SMTP_PASSWORD
- DISCOURSE_SMTP_AUTHENTICATION
- DISCOURSE_SMTP_ENABLE_START_TLS
- DISCOURSE_NOTIFICATION_EMAIL
volumes:
- 'discourse_data:/bitnami/discourse'
- 'discourse_shared:/shared'
# transition only: legacy bitnami volume, read-only, for one-time upload migration
- 'discourse_data:/legacy:ro'
secrets:
- db_password
configs:
- source: app_entrypoint
target: /usr/local/bin/cc-app-entrypoint.sh
mode: 0555
- source: app_install_ssl
target: /etc/runit/1.d/install-ssl
mode: 0555
- source: app_migrate_uploads
target: /etc/runit/1.d/02-migrate-bitnami-uploads
mode: 0555
depends_on:
- db
- redis
deploy:
update_config:
failure_action: rollback
order: start-first
order: stop-first
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "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.8.1+3.5.0"
- "coop-cloud.${STACK_NAME}.version=1.0.0+3.5.3"
healthcheck:
test: "ruby -e \"require 'uri'; require 'net/http'; uri = URI('http://localhost:3000/srv/status'); res = Net::HTTP.get_response(uri); if res.is_a?(Net::HTTPSuccess) then exit (0) else exit (1) end\""
test: "curl -fsS http://localhost/srv/status || exit 1"
interval: 30s
timeout: 10s
retries: 6
start_period: 20m
start_period: 25m
db:
image: pgvector/pgvector:pg17
@ -72,6 +83,15 @@ services:
- POSTGRES_USER=discourse
- POSTGRES_DB=discourse
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
healthcheck:
test: "pg_isready -U discourse -d discourse"
interval: 30s
timeout: 10s
retries: 5
# generous: a postgres major-version upgrade (apt install + pg_upgrade) runs
# in the entrypoint before the server accepts connections — don't let the
# healthcheck kill an in-progress migration
start_period: 10m
deploy:
labels:
backupbot.backup: "true"
@ -85,35 +105,12 @@ services:
- internal
volumes:
- 'redis_data:/data'
sidekiq:
image: bitnamilegacy/discourse:3.5.0
networks:
- proxy
- internal
depends_on:
- discourse
volumes:
- 'discourse_data:/bitnami/discourse'
command: /opt/bitnami/scripts/discourse-sidekiq/run.sh
secrets:
- db_password
environment:
- ALLOW_EMPTY_PASSWORD=yes
- DISCOURSE_DATABASE_HOST=db
- DISCOURSE_DATABASE_NAME=discourse
- DISCOURSE_DATABASE_PASSWORD_FILE=/run/secrets/db_password
- DISCOURSE_DATABASE_PORT_NUMBER=5432
- DISCOURSE_DATABASE_USER=discourse
- DISCOURSE_HOST=${DOMAIN}
- DISCOURSE_REDIS_HOST=redis
- DISCOURSE_REDIS_PORT_NUMBER=6379
- DISCOURSE_SMTP_HOST
- DISCOURSE_SMTP_PORT
- DISCOURSE_SMTP_PROTOCOL
- DISCOURSE_SMTP_USER
- PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0
- DISCOURSE_SMTP_AUTH
healthcheck:
test: "redis-cli ping | grep -q PONG"
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
secrets:
db_password:
@ -123,6 +120,7 @@ secrets:
volumes:
postgresql_data:
redis_data:
discourse_shared:
discourse_data:
networks:
@ -131,6 +129,15 @@ networks:
internal:
configs:
app_entrypoint:
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION}
file: cc-app-entrypoint.sh
app_install_ssl:
name: ${STACK_NAME}_app_install_ssl_${APP_INSTALL_SSL_VERSION}
file: app-install-ssl.sh
app_migrate_uploads:
name: ${STACK_NAME}_app_migrate_uploads_${APP_MIGRATE_UPLOADS_VERSION}
file: migrate-uploads.sh
db_entrypoint:
name: ${STACK_NAME}_db_entrypoint_${DB_ENTRYPOINT_VERSION}
file: entrypoint.postgres.sh.tmpl