Service “activitypub-migrate” didn’t complete successfully

I am migrating my site to Ghost 6.3 with the docker method so that I can make use of Activity pub on a local instance.
It works perfectly when I don’t enable Activitypub.

When I run the “docker compose up -d --force-recreate ghost caddy” comand, it gives the following error when trying to get a local AP instance running.

/opt/ghost$ docker compose up -d --force-recreate ghost caddy
[+] Running 4/4
:check_mark: Container ghost-db-1 Healthy 1.3s
:check_mark: Container ghost-ghost-1 Recreated 0.0s
:check_mark: Container ghost-caddy-1 Recreated 0.0s
✘ Container ghost-activitypub-migrate-1 service “activitypub-migrate” didn’t complete successfully: exit 1 0.7s
service “activitypub-migrate” didn’t complete successfully: exit 1

I can’t see anything obvious in the syslog.
If I comment out the Activitypub settings in the .env file and start the docker instances, it works fine again (but without a local Activitypub instance).
I have searched for the error, but can’t find anything.

I will try a fresh install, but this time enable Activitypub during the initial set up, rather than afterwards.

I got it working by completing all steps with the initial build (ghost, caddy and activitypub), rather than doing it in two stages