mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-14 07:26:45 +00:00
no ref - The goal here is to be able to provide more functionality to self-hosters through snippets and other segmented config - Some customers run Admin <-> content domains on separate ones which our current config doesn't support - Our current config also hardcodes a www redirect which complicates setups when you don't have that domain setup or don't even want it - Moving to a default template customers will have to copy which includes snippets allows us to update these later on without breaking peoples setups
210 lines
6.5 KiB
YAML
210 lines
6.5 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/compose-spec/compose-spec/main/schema/compose-spec.json
|
|
services:
|
|
caddy:
|
|
image: caddy:2.10.0-alpine@sha256:e2e3a089760c453bc51c4e718342bd7032d6714f15b437db7121bfc2de2654a6
|
|
restart: always
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
environment:
|
|
DOMAIN: ${DOMAIN:?DOMAIN environment variable is required}
|
|
ACTIVITYPUB_TARGET: ${ACTIVITYPUB_TARGET:-https://ap.ghost.org}
|
|
volumes:
|
|
- ./caddy:/etc/caddy
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
depends_on:
|
|
- ghost
|
|
networks:
|
|
- ghost_network
|
|
|
|
ghost:
|
|
# Do not alter this without updating the Tinybird Sync container as well
|
|
image: ghost:${GHOST_VERSION:-5-alpine}
|
|
restart: always
|
|
expose:
|
|
- "127.0.0.1:${GHOST_PORT:-2368}:2368"
|
|
# This is required to import current config when migrating
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
NODE_ENV: production
|
|
url: https://${DOMAIN:?DOMAIN environment variable is required}
|
|
database__client: mysql
|
|
database__connection__host: db
|
|
database__connection__user: ${DATABASE_USER:-ghost}
|
|
database__connection__password: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required}
|
|
database__connection__database: ghost
|
|
enableDeveloperExperiments: ${ENABLE_DEVELOPER_EXPERIMENTS:-false}
|
|
labs__ActivityPub: ${ENABLE_ACTIVITYPUB:-false}
|
|
labs__trafficAnalytics: ${ENABLE_TRAFFIC_ANALYTICS:-false}
|
|
tinybird__tracker__endpoint: https://${DOMAIN:?DOMAIN environment variable is required}/.ghost/analytics/api/v1/page_hit
|
|
tinybird__adminToken: ${TINYBIRD_ADMIN_TOKEN:-}
|
|
tinybird__workspaceId: ${TINYBIRD_WORKSPACE_ID:-}
|
|
tinybird__tracker__datasource: analytics_events
|
|
tinybird__stats__endpoint: ${TINYBIRD_API_URL:-https://api.tinybird.co}
|
|
volumes:
|
|
- ${UPLOAD_LOCATION:-./data/ghost}:/var/lib/ghost/content
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
tinybird-sync:
|
|
condition: service_completed_successfully
|
|
required: false
|
|
tinybird-deploy:
|
|
condition: service_completed_successfully
|
|
required: false
|
|
activitypub:
|
|
condition: service_started
|
|
required: false
|
|
networks:
|
|
- ghost_network
|
|
|
|
db:
|
|
image: mysql:8.0.42@sha256:4445b2668d41143cb50e471ee207f8822006249b6859b24f7e12479684def5d9
|
|
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:
|
|
- ${MYSQL_DATA_LOCATION:-./data/mysql}:/var/lib/mysql
|
|
- ./mysql-init:/docker-entrypoint-initdb.d
|
|
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
|
|
|
|
traffic-analytics:
|
|
image: ghost/traffic-analytics:1.0.1@sha256:037e019b2e0a0733e9cdf8a032e9ea88e9263d8cbf2bdb5188d91bf7cef7129a
|
|
restart: always
|
|
expose:
|
|
- "3000"
|
|
volumes:
|
|
- traffic_analytics_data:/data
|
|
environment:
|
|
NODE_ENV: production
|
|
PROXY_TARGET: ${TINYBIRD_API_URL:-https://api.tinybird.co}/v0/events
|
|
SALT_STORE_TYPE: ${SALT_STORE_TYPE:-file}
|
|
SALT_STORE_FILE_PATH: /data/salts.json
|
|
TINYBIRD_TRACKER_TOKEN: ${TINYBIRD_TRACKER_TOKEN:-}
|
|
LOG_LEVEL: debug
|
|
profiles: [analytics]
|
|
networks:
|
|
- ghost_network
|
|
|
|
activitypub:
|
|
image: ghcr.io/tryghost/activitypub:1.0.1@sha256:eafd011c93ced77e51a59358600ebc26cc007f3f61a4be8d759d43df21fe48c4
|
|
restart: always
|
|
expose:
|
|
- "8080"
|
|
volumes:
|
|
- ${UPLOAD_LOCATION:-./data/ghost}:/opt/activitypub/content
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 8080
|
|
MYSQL_HOST: db
|
|
MYSQL_USER: ${DATABASE_USER:-ghost}
|
|
MYSQL_PASSWORD: ${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required}
|
|
MYSQL_DATABASE: activitypub
|
|
ALLOW_PRIVATE_ADDRESS: true
|
|
USE_MQ: false
|
|
LOCAL_STORAGE_PATH: /opt/activitypub/content/images/activitypub
|
|
LOCAL_STORAGE_HOSTING_URL: https://${DOMAIN}/content/images/activitypub
|
|
depends_on:
|
|
- db
|
|
profiles: [activitypub]
|
|
networks:
|
|
- ghost_network
|
|
|
|
# Suporting Services
|
|
|
|
tinybird-login:
|
|
build:
|
|
context: ./tinybird
|
|
dockerfile: Dockerfile
|
|
working_dir: /home/tinybird
|
|
command: /usr/local/bin/tinybird-login
|
|
volumes:
|
|
- tinybird_home:/home/tinybird
|
|
- tinybird_files:/data/tinybird
|
|
profiles: [analytics]
|
|
networks:
|
|
- ghost_network
|
|
tty: false
|
|
restart: no
|
|
|
|
tinybird-sync:
|
|
# Do not alter this without updating the Ghost container as well
|
|
image: ghost:${GHOST_VERSION:-5-alpine}
|
|
command: >
|
|
sh -c "
|
|
if [ -d /var/lib/ghost/current/core/server/data/tinybird ]; then
|
|
rm -rf /data/tinybird/*;
|
|
cp -rf /var/lib/ghost/current/core/server/data/tinybird/* /data/tinybird/;
|
|
echo 'Tinybird files synced into shared volume.';
|
|
else
|
|
echo 'Tinybird source directory not found.';
|
|
fi
|
|
"
|
|
volumes:
|
|
- tinybird_files:/data/tinybird
|
|
depends_on:
|
|
tinybird-login:
|
|
condition: service_completed_successfully
|
|
networks:
|
|
- ghost_network
|
|
profiles: [analytics]
|
|
restart: no
|
|
|
|
tinybird-deploy:
|
|
build:
|
|
context: ./tinybird
|
|
dockerfile: Dockerfile
|
|
working_dir: /data/tinybird
|
|
command: >
|
|
sh -c "
|
|
tb-wrapper --cloud deploy
|
|
"
|
|
volumes:
|
|
- tinybird_home:/home/tinybird
|
|
- tinybird_files:/data/tinybird
|
|
depends_on:
|
|
tinybird-sync:
|
|
condition: service_completed_successfully
|
|
profiles: [analytics]
|
|
networks:
|
|
- ghost_network
|
|
tty: true
|
|
|
|
activitypub-migrate:
|
|
image: ghcr.io/tryghost/activitypub-migrations:1.0.1@sha256:b9379134c3b2eeb12cfeadd6851d1ca6fbbe852147195676414f165b0a6e1f93
|
|
environment:
|
|
MYSQL_DB: mysql://${DATABASE_USER:-ghost}:${DATABASE_PASSWORD:?DATABASE_PASSWORD environment variable is required}@tcp(db:3306)/activitypub
|
|
networks:
|
|
- ghost_network
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
profiles: [activitypub]
|
|
restart: no
|
|
|
|
volumes:
|
|
caddy_data:
|
|
caddy_config:
|
|
tinybird_files:
|
|
tinybird_home:
|
|
traffic_analytics_data:
|
|
|
|
networks:
|
|
ghost_network:
|