From ab91895424b2c1a74299d6a1335c31e3efb4785d Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Wed, 13 May 2026 16:47:55 +0100 Subject: add migrations in the build --- communities/red-right-hand/174bg.net/Dockerfile | 3 --- communities/red-right-hand/174bg.net/README.md | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'communities') diff --git a/communities/red-right-hand/174bg.net/Dockerfile b/communities/red-right-hand/174bg.net/Dockerfile index 9d959cb..bf4fce4 100644 --- a/communities/red-right-hand/174bg.net/Dockerfile +++ b/communities/red-right-hand/174bg.net/Dockerfile @@ -89,9 +89,6 @@ ENV HOSTNAME="0.0.0.0" # Copy production assets COPY --from=builder --chown=node:node /app/public ./public -# Copy auth config so migrations can be run against the production container -COPY --from=builder --chown=node:node /app/src ./src - # Set the correct permission for prerender cache RUN mkdir .next RUN chown node:node .next diff --git a/communities/red-right-hand/174bg.net/README.md b/communities/red-right-hand/174bg.net/README.md index 71f534e..b1d2ba4 100644 --- a/communities/red-right-hand/174bg.net/README.md +++ b/communities/red-right-hand/174bg.net/README.md @@ -8,8 +8,10 @@ The website is built using [Next.js](https://nextjs.org/) and is deployed via [D ### First Run -After starting the containers, run the following command to apply database migrations: +After starting the containers, apply the database migrations by piping each SQL file in `better-auth_migrations/` into the postgres container: ```sh -docker compose exec 174bg-net npx auth@latest migrate --config src/auth.js --yes +cat better-auth_migrations/*.sql | docker compose exec -T postgres psql -U postgres -d postgres ``` + +> If your `.env` uses a different `POSTGRES_USER` or `POSTGRES_DB`, substitute those values for `postgres` above. -- cgit v1.2.3