Skip to content

Commit f0be329

Browse files
fix(docker): use npm for ephemeral migration containers to avoid pnpm cold-install overhead in CI
1 parent 5ccfb8e commit f0be329

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@ services:
123123
DB_USER: nostr_ts_relay
124124
DB_PASSWORD: nostr_ts_relay
125125
DB_NAME: nostr_ts_relay
126+
# Using npm intentionally: this is an isolated, ephemeral container that
127+
# only needs knex+pg for migrations. Avoids corepack/pnpm cold-install overhead.
126128
entrypoint:
127129
- sh
128130
- -c
129-
- 'cd code && corepack enable && corepack prepare pnpm@10.33.0 --activate && pnpm dlx --package=knex@2.4.0 --package=pg@8.8.0 knex migrate:latest'
131+
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
130132
volumes:
131133
- ./migrations:/code/migrations
132134
- ./knexfile.js:/code/knexfile.js

test/integration/docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ services:
7474
DB_USER: postgres
7575
DB_PASSWORD: postgres
7676
DB_NAME: nostr_ts_relay_test
77+
# Using npm intentionally: this is an isolated, ephemeral container that
78+
# only needs knex+pg for migrations. Avoids corepack/pnpm cold-install
79+
# overhead (~15min) with no caching benefit in CI.
7780
entrypoint:
7881
- sh
7982
- -c
80-
- 'cd code && corepack enable && corepack prepare pnpm@10.33.0 --activate && pnpm dlx --package=knex@2.4.0 --package=pg@8.8.0 knex migrate:latest'
83+
- 'cd code && npm install --no-save --quiet knex@2.4.0 pg@8.8.0 && npx knex migrate:latest'
8184
volumes:
8285
- ../../migrations:/code/migrations
8386
- ../../knexfile.js:/code/knexfile.js

0 commit comments

Comments
 (0)