services: activitypub: build: . ports: - "9229:9229" volumes: - ./src:/opt/activitypub/src - ./dist:/opt/activitypub/dist - 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 - ACTIVITYPUB_COLLECTION_PAGE_SIZE=20 - 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: yarn 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.73.0@sha256:fe884668a2bf8d586b6fb7697d48a6a19a02f9e78a1eddf09c5b0f08c27d63b9 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 cleanup-expired-key-value-records: build: jobs/cleanup-expired-key-value-records environment: - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_HOST=mysql - MYSQL_PORT=3306 - MYSQL_DATABASE=activitypub scripts: build: dev/scripts depends_on: - activitypub - fake-mastodon 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.6@sha256:0a2a40b552410757015645e28f727f6ad18b7ff8a7cb697871ccadd238778dcb 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:bb186d083732f669da90be8b0f975a37812b15e913465bb14d845db72a4e3e08 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:499.0.0-emulators@sha256:38606e0ec8b892ff2be6fb7238c6b98e7b0b69f60ed433fa2b196bdf4646caf9 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: . 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 - ACTIVITYPUB_COLLECTION_PAGE_SIZE=2 - REDIS_HOST=redis-testing - REDIS_PORT=6379 - FEDIFY_KV_STORE_TYPE=redis command: yarn 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 cleanup-expired-key-value-records-testing: build: jobs/cleanup-expired-key-value-records environment: - MYSQL_USER=ghost - MYSQL_PASSWORD=password - MYSQL_HOST=mysql-testing - MYSQL_PORT=3306 - MYSQL_DATABASE=activitypub cucumber-tests: networks: - test_network build: . 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.6@sha256:0a2a40b552410757015645e28f727f6ad18b7ff8a7cb697871ccadd238778dcb 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:bb186d083732f669da90be8b0f975a37812b15e913465bb14d845db72a4e3e08 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:499.0.0-emulators@sha256:38606e0ec8b892ff2be6fb7238c6b98e7b0b69f60ed433fa2b196bdf4646caf9 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 - carol.test - fake-external-activitypub.test image: caddy:2@sha256:4163a5c7b7631707956db4057720ec75de429992d5e3aa518d54872c01644dbe ports: - "443: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.1-1@sha256:d61e7720f89483fdef5366843b58d1dfd06bcce5828179c9f2f54de5c28354b0 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.1-1@sha256:d61e7720f89483fdef5366843b58d1dfd06bcce5828179c9f2f54de5c28354b0 entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", "--port=80", "--https-port=443", ] fake-mastodon: networks: test_network: aliases: - fake-mastodon.test image: wiremock/wiremock:3.13.1-1@sha256:d61e7720f89483fdef5366843b58d1dfd06bcce5828179c9f2f54de5c28354b0 entrypoint: [ "/docker-entrypoint.sh", "--global-response-templating", "--disable-gzip", "--verbose", ] 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: