--- # yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/main/schema/compose-spec.json # Based on https://github.com/TryGhost/ghost-docker and https://noted.lol/self-host-ghost/ # I removed caddy and tinnybird services: ghost: # Do not alter this without updating the Tinybird Sync container as well image: ghost:${GHOST_VERSION:-6-alpine} restart: always ports: # we need ports for testing - 2368:2368 #expose: #- "127.0.0.1:${GHOST_PORT:-2368}" # This is required to import current config when migrating # IMPORTANT # In usual install use .env # In case of portainer.io use stack.env env_file: stack.env environment: NODE_ENV: production url: https://${DOMAIN:?DOMAIN environment variable is required} admin__url: ${ADMIN_DOMAIN:+https://${ADMIN_DOMAIN}} database__client: mysql database__connection__host: ghost-db database__connection__user: ${DATABASE_USER:-ghost} database__connection__password: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required} database__connection__database: ghost volumes: - ${UPLOAD_LOCATION:-./data/ghost}:/var/lib/ghost/content depends_on: ghost-db: condition: service_healthy activitypub: condition: service_started required: false networks: - ghost_network ghost-db: image: mysql:8 restart: always expose: - "3306" environment: MYSQL_ROOT_PASSWORD: ${DATABASE_ROOT_PASSWORD:?DATABASE_ROOT_PASSWORD environment variable is required} MYSQL_USER: ${DATABASE_USER:-ghost} MYSQL_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required} MYSQL_DATABASE: ghost MYSQL_MULTIPLE_DATABASES: activitypub volumes: - /var/lib/docker/mysql-init-script:/docker-entrypoint-initdb.d - ${MYSQL_DATA_LOCATION:-./data/mysql}:/var/lib/mysql healthcheck: test: mysqladmin ping -p$$MYSQL_ROOT_PASSWORD -h 127.0.0.1 interval: 1s start_period: 30s start_interval: 10s retries: 120 networks: - ghost_network activitypub: image: ghcr.io/tryghost/activitypub:1.1.0 restart: always expose: - "8080" volumes: - ${UPLOAD_LOCATION:-./data/ghost}:/opt/activitypub/content environment: # See https://github.com/TryGhost/ActivityPub/blob/main/docs/env-vars.md NODE_ENV: production MYSQL_HOST: ghost-db MYSQL_USER: ${DATABASE_USER:-ghost} MYSQL_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required} MYSQL_DATABASE: activitypub LOCAL_STORAGE_PATH: /opt/activitypub/content/images/activitypub LOCAL_STORAGE_HOSTING_URL: https://${DOMAIN}/content/images/activitypub depends_on: ghost-db: condition: service_healthy activitypub-migrate: condition: service_completed_successfully profiles: [activitypub] networks: - ghost_network # Suporting Services activitypub-migrate: image: ghcr.io/tryghost/activitypub-migrations:1.1.0 environment: MYSQL_DB: mysql://${DATABASE_USER:-ghost}:${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required}@tcp(ghost-db:3306)/activitypub networks: - ghost_network depends_on: ghost-db: condition: service_healthy profiles: [activitypub] restart: no networks: ghost_network: name: ghost_network