services: activitypub: build: context: . target: dev ports: - "8080:8080" - "9229:9229" volumes: - ./src:/opt/activitypub/src - dev-content:/opt/activitypub/content environment: - PORT=8080 - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_HOST=mysql - MYSQL_PORT=3306 - MYSQL_DATABASE=activitypub - NODE_ENV=development - ALLOW_PRIVATE_ADDRESS=true - SKIP_SIGNATURE_VERIFICATION=true - USE_MQ=true - MQ_PUBSUB_PROJECT_ID=activitypub - MQ_PUBSUB_HOST=pubsub:8085 - MQ_PUBSUB_TOPIC_NAME=fedify-topic - MQ_PUBSUB_RETRY_TOPIC_NAME=fedify-retry-topic - MQ_PUBSUB_USE_RETRY_TOPIC=true - MQ_PUBSUB_MAX_DELIVERY_ATTEMPTS=5 - MQ_PUBSUB_GHOST_TOPIC_NAME=ghost-topic - GCP_BUCKET_NAME=activitypub - GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443 # - GCS_LOCAL_STORAGE_HOSTING_URL=https:///.ghost/activitypub/gcs - LOCAL_STORAGE_PATH=/opt/activitypub/content # - LOCAL_STORAGE_HOSTING_URL=https:///.ghost/activitypub/local-storage # - GHOST_PRO_IP_ADDRESSES=100.83.192.90,192.168.65.1 - REDIS_HOST=redis - REDIS_PORT=6379 - FEDIFY_KV_STORE_TYPE=redis command: pnpm build:watch depends_on: migrate: condition: service_completed_successfully mysql: condition: service_healthy redis: condition: service_healthy pubsub: condition: service_healthy fake-gcs: condition: service_healthy jaeger: image: jaegertracing/all-in-one:1.76.0@sha256:ab6f1a1f0fb49ea08bcd19f6b84f6081d0d44b364b6de148e1798eb5816bacac restart: always environment: COLLECTOR_ZIPKIN_HOST_PORT: :9411 migrate: build: migrate volumes: - ./migrate/migrations:/migrations environment: - MYSQL_DB=mysql://ghost:password@tcp(mysql:3306)/activitypub depends_on: mysql: condition: service_healthy nginx: build: dev/nginx ports: - "80:80" volumes: - dev-content:/content:ro - ./dev/fake-gcs/storage:/gcp-storage:ro depends_on: - activitypub mysql: image: mysql:8.4.11@sha256:3466ba4a4828aa8d46fb7c3bc16b67b781c98413cf4ea0fac6feaa6e881faa26 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_DATABASE=activitypub ports: - "3307:3306" healthcheck: test: "mysql -ughost -ppassword activitypub -e 'select 1'" interval: 1s retries: 120 redis: image: redis:7-alpine@sha256:ff02b58f971e7d7d156a1267e283fcbbeee91773b6aa36c49dac28ecfe28eadf volumes: - ./dev/redis/start.sh:/usr/local/bin/start.sh command: /usr/local/bin/start.sh ports: - "6380:6379" healthcheck: test: ["CMD", "redis-cli", "-p", "6379", "cluster", "info"] interval: 1s retries: 120 pubsub: image: gcr.io/google.com/cloudsdktool/google-cloud-cli:583.0.0-emulators@sha256:07e4b8c3075ca793552fcfaf4808f104ef155d7805d87ade8e01b440463be262 command: /bin/bash -c "/opt/activitypub/start-pubsub.sh" volumes: - ./dev/pubsub/start.sh:/opt/activitypub/start-pubsub.sh environment: - PROJECT_ID=activitypub - FEDIFY_TOPIC_NAME=fedify-topic - FEDIFY_SUBSCRIPTION_NAME=fedify-subscription - FEDIFY_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/fedify/push - FEDIFY_RETRY_TOPIC_NAME=fedify-retry-topic - FEDIFY_RETRY_SUBSCRIPTION_NAME=fedify-subscription-retry - FEDIFY_RETRY_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/fedify/push - GHOST_TOPIC_NAME=ghost-topic - GHOST_SUBSCRIPTION_NAME=ghost-subscription - GHOST_PUSH_ENDPOINT=http://activitypub:8080/.ghost/activitypub/pubsub/ghost/push healthcheck: test: "curl -f http://localhost:8085 || exit 1" interval: 1s retries: 120 start_period: 5s activitypub-testing: networks: - test_network build: context: . target: dev volumes: - ./src:/opt/activitypub/src - ./vitest.config.ts:/opt/activitypub/vitest.config.ts - test-content:/opt/activitypub/content environment: - LOCAL_STORAGE_PATH=/opt/activitypub/content - PORT=8083 - MYSQL_USER=root - MYSQL_PASSWORD=root - MYSQL_HOST=mysql-testing - MYSQL_PORT=3306 - MYSQL_DATABASE=activitypub - NODE_ENV=testing - SKIP_SIGNATURE_VERIFICATION=true - ALLOW_PRIVATE_ADDRESS=true - NODE_TLS_REJECT_UNAUTHORIZED=0 - USE_MQ=true - MQ_PUBSUB_PROJECT_ID=activitypub - MQ_PUBSUB_HOST=pubsub-testing:8085 - MQ_PUBSUB_TOPIC_NAME=fedify-topic - MQ_PUBSUB_RETRY_TOPIC_NAME=fedify-retry-topic - MQ_PUBSUB_USE_RETRY_TOPIC=true - MQ_PUBSUB_MAX_DELIVERY_ATTEMPTS=5 - MQ_PUBSUB_GHOST_TOPIC_NAME=ghost-topic - GCP_BUCKET_NAME=activitypub - GCS_LOCAL_STORAGE_HOSTING_URL=http://fake-gcs:4443/.ghost/activitypub/gcs - GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443 - REDIS_HOST=redis-testing - REDIS_PORT=6379 - FEDIFY_KV_STORE_TYPE=redis command: pnpm build:watch depends_on: migrate-testing: condition: service_completed_successfully mysql-testing: condition: service_healthy redis-testing: condition: service_healthy pubsub-testing: condition: service_healthy fake-gcs: condition: service_healthy healthcheck: test: 'if [ ! -f /tmp/health.txt ]; then (wget --spider http://0.0.0.0:8083/ping || exit 1) && touch /tmp/health.txt ; else echo "healthcheck already executed"; fi' interval: 1s retries: 120 start_period: 5s migrate-testing: networks: - test_network build: migrate volumes: - ./migrate/migrations:/migrations environment: - MYSQL_DB=mysql://ghost:password@tcp(mysql-testing:3306)/activitypub depends_on: mysql-testing: condition: service_healthy cucumber-tests: networks: - test_network build: context: . target: dev volumes: - ./features:/opt/activitypub/features - ./cucumber.js:/opt/activitypub/cucumber.js environment: - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_HOST=mysql-testing - MYSQL_PORT=3306 - MYSQL_DATABASE=activitypub - NODE_ENV=testing - NODE_TLS_REJECT_UNAUTHORIZED=0 - GCP_BUCKET_NAME=activitypub - GCP_STORAGE_EMULATOR_HOST=http://fake-gcs:4443 - GCS_LOCAL_STORAGE_HOSTING_URL=https://self.test/.ghost/activitypub/gcs - TAGS - URL_GHOST_ACTIVITY_PUB=https://self.test - URL_EXTERNAL_ACTIVITY_PUB=https://fake-external-activitypub.test command: /opt/activitypub/node_modules/.bin/cucumber-js depends_on: caddy-testing: condition: service_started activitypub-testing: condition: service_healthy mysql-testing: networks: - test_network image: mysql:8.4.11@sha256:3466ba4a4828aa8d46fb7c3bc16b67b781c98413cf4ea0fac6feaa6e881faa26 environment: - MYSQL_ROOT_PASSWORD=root - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_DATABASE=activitypub healthcheck: test: "mysql -ughost -ppassword activitypub -e 'select 1'" interval: 1s retries: 120 redis-testing: networks: - test_network image: redis:7-alpine@sha256:ff02b58f971e7d7d156a1267e283fcbbeee91773b6aa36c49dac28ecfe28eadf volumes: - ./dev/redis/start.sh:/usr/local/bin/start.sh command: /usr/local/bin/start.sh healthcheck: test: ["CMD", "redis-cli", "-p", "6379", "cluster", "info"] interval: 1s retries: 120 pubsub-testing: networks: - test_network image: gcr.io/google.com/cloudsdktool/google-cloud-cli:583.0.0-emulators@sha256:07e4b8c3075ca793552fcfaf4808f104ef155d7805d87ade8e01b440463be262 command: /bin/bash -c "/opt/activitypub/start-pubsub.sh" volumes: - ./dev/pubsub/start.sh:/opt/activitypub/start-pubsub.sh environment: - PROJECT_ID=activitypub - FEDIFY_TOPIC_NAME=fedify-topic - FEDIFY_SUBSCRIPTION_NAME=fedify-subscription - FEDIFY_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/fedify/push - FEDIFY_RETRY_TOPIC_NAME=fedify-retry-topic - FEDIFY_RETRY_SUBSCRIPTION_NAME=fedify-subscription-retry - FEDIFY_RETRY_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/fedify/push - GHOST_TOPIC_NAME=ghost-topic - GHOST_SUBSCRIPTION_NAME=ghost-subscription - GHOST_PUSH_ENDPOINT=http://activitypub-testing:8083/.ghost/activitypub/pubsub/ghost/push healthcheck: test: "curl -f http://localhost:8085 || exit 1" interval: 1s retries: 120 start_period: 5s caddy-testing: networks: test_network: aliases: - self.test - alice.test - bob.test - charlie.test - fake-external-activitypub.test image: caddy:2@sha256:df7f1c2fb114453b951de51a98efc010db1655a92c2e86be6706714e2417a78d ports: - "444:443" volumes: - ./dev/caddy-testing/Caddyfile:/etc/caddy/Caddyfile - caddy_data:/data - caddy_config:/config environment: - NODE_TLS_REJECT_UNAUTHORIZED=0 depends_on: activitypub-testing: condition: service_started ghost-wiremock: condition: service_started external-wiremock: condition: service_started ghost-wiremock: networks: - test_network image: wiremock/wiremock:3.13.2-1@sha256:8bdd64a25db911ba521a38aebf1590d96767c2d29f3e941e2f496a760bbdf47d entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", "--port=80", "--https-port=443", ] external-wiremock: networks: - test_network image: wiremock/wiremock:3.13.2-1@sha256:8bdd64a25db911ba521a38aebf1590d96767c2d29f3e941e2f496a760bbdf47d entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", "--port=80", "--https-port=443", ] fake-gcs: build: dev/fake-gcs environment: - GCP_BUCKET_NAME=activitypub - GCP_PROJECT_ID=activitypub volumes: - ./dev/fake-gcs/storage:/storage networks: default: aliases: - fake-gcs test_network: aliases: - fake-gcs healthcheck: test: "curl -f http://localhost:4443/storage/v1/b/${GCP_BUCKET_NAME}" interval: 1s retries: 120 start_period: 5s networks: test_network: driver: bridge volumes: test-content: dev-content: caddy_data: caddy_config: