Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Docker Compose profiles to enable
## Run `docker compose config --profiles` to see all available profiles
## See https://docs.docker.com/compose/how-tos/profiles/ for more information
COMPOSE_PROFILES=ghost
# COMPOSE_PROFILES=stripe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the default profile? Just because it's not necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! The default profile is part of the "legacy" docker environment, where by default only mysql + redis run.


# Debug level to pass to Ghost
# DEBUG=
Expand Down
20 changes: 20 additions & 0 deletions compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ services:
- ghost-dev-media:/home/ghost/ghost/core/content/media
- ghost-dev-files:/home/ghost/ghost/core/content/files
- ghost-dev-logs:/home/ghost/ghost/core/content/logs
- shared-config:/mnt/shared-config:ro
environment:
NODE_ENV: development
NODE_TLS_REJECT_UNAUTHORIZED: "0"
Expand Down Expand Up @@ -97,6 +98,9 @@ services:
condition: service_healthy
mailpit:
condition: service_healthy
stripe:
condition: service_healthy
required: false
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:2368',{redirect:'manual'}).then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))"]
timeout: 5s
Expand All @@ -122,10 +126,26 @@ services:
ghost-dev:
condition: service_healthy

stripe:
image: stripe/stripe-cli:latest
container_name: ghost-dev-stripe
entrypoint: ["/entrypoint.sh"]
profiles: ["stripe"]
volumes:
- ./docker/stripe/entrypoint.sh:/entrypoint.sh:ro
- shared-config:/mnt/shared-config
environment:
- GHOST_URL=http://ghost-dev:2368
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
healthcheck:
test: ["CMD", "test", "-f", "/mnt/shared-config/.env.stripe"]
interval: 1s
retries: 120

volumes:
mysql-data:
redis-data:
shared-config:
ghost-dev-data:
ghost-dev-images:
ghost-dev-media:
Expand Down
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ services:
- ./docker/stripe/entrypoint.sh:/entrypoint.sh:ro
- shared-config:/mnt/shared-config
environment:
- GHOST_URL=http://server:2368
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY:-}
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY:-}
- STRIPE_ACCOUNT_ID=${STRIPE_ACCOUNT_ID:-}
Expand Down
12 changes: 12 additions & 0 deletions docker/ghost-dev/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ else
echo "WARNING: Tinybird not enabled: .env.tinybird file not found at /mnt/shared-config/.env.tinybird" >&2
fi


# Configure Stripe webhook secret
if [ -f /mnt/shared-config/.env.stripe ]; then
source /mnt/shared-config/.env.stripe
if [ -n "${STRIPE_WEBHOOK_SECRET:-}" ]; then
export WEBHOOK_SECRET="$STRIPE_WEBHOOK_SECRET"
echo "Stripe webhook secret configured successfully"
else
echo "WARNING: Stripe webhook secret not found in shared config"
fi
fi

# Execute the CMD
exec "$@"

4 changes: 2 additions & 2 deletions docker/stripe/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ else
fi

# Start stripe listen in the background
echo "Starting Stripe webhook listener forwarding to http://server:2368/members/webhooks/stripe/"
stripe listen --forward-to http://server:2368/members/webhooks/stripe/ --api-key "${STRIPE_SECRET_KEY}" &
echo "Starting Stripe webhook listener forwarding to ${GHOST_URL}/members/webhooks/stripe/"
stripe listen --forward-to ${GHOST_URL}/members/webhooks/stripe/ --api-key "${STRIPE_SECRET_KEY}" &
child=$!

# Wait for the child process
Expand Down
Loading