Skip to content

Commit b694767

Browse files
committed
Improved Docker workflow
ref https://linear.app/ghost/issue/AP-550/overhaul-docker-testing-setup - made `activitypub` rely on `migrate` so we run migrations in dev - fixed `yarn fix` actually removing the images - `yarn dev` will now try and recreate the containers, which will often no-op, but they'll be updated if the package.json changes
1 parent c8f5322 commit b694767

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ services:
1515
- SKIP_SIGNATURE_VERIFICATION=true
1616
command: yarn build:watch
1717
depends_on:
18+
migrate:
19+
condition: service_started
1820
mysql:
1921
condition: service_healthy
2022
pubsub:

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"scripts": {
1010
"build": "esbuild src/app.ts --platform=neutral --packages=external --bundle --outfile=dist/app.js",
1111
"build:watch": "concurrently \"yarn build --watch\" \"node --watch dist/app.js\"",
12-
"dev": "docker compose up activitypub nginx -d",
12+
"dev": "docker compose up activitypub nginx -d --build",
1313
"stop": "docker compose stop",
1414
"db": "docker compose exec mysql mysql -uroot -proot activitypub",
15-
"fix": "docker compose rm activitypub nginx -sf && docker compose build activitypub nginx",
15+
"fix": "docker compose down --rmi all activitypub activitypub-testing cucumber-tests nginx",
1616
"logs": "docker compose logs activitypub -f",
1717
"test:cucumber": "docker compose run --rm migrate-testing up && docker compose up cucumber-tests --exit-code-from cucumber-tests",
1818
"test": "docker compose run --rm migrate-testing up && docker compose run --rm activitypub-testing yarn test:all && yarn test:cucumber",

0 commit comments

Comments
 (0)