Commit Graph

5 Commits

Author SHA1 Message Date
twotalesanimation 396ebf9837 Run database migrations as part of the deploy
Deploy / deploy (push) Successful in 3m45s
The deploy workflow pulled, built and started the app, but never applied
migrations. Shipping a change that adds a table therefore broke the app
until someone remembered to migrate by hand -- the new api_keys table
would have done exactly that to the settings page.

The workflow now builds, applies pending migrations, and only then starts
the app. A failed migration exits non-zero, so the deploy fails instead of
starting an app whose schema is behind its code. Because `up -d` is never
reached in that case, production keeps serving the previous containers.

Migrations run through a new `migrate` compose service built from the
Dockerfile's builder stage, rather than `docker compose exec app npx
prisma migrate deploy` as the README previously suggested. The production
image copies prisma/ and node_modules/.prisma but not the Prisma CLI,
which is a devDependency and is absent from the standalone bundle, so that
command would have had npx download Prisma inside the container at runtime
as the unprivileged nextjs user. The builder stage has the CLI and its
engines already.

The service sits behind a `tools` profile so `docker compose up` never
starts it, and takes DATABASE_URL from compose rather than a .env file --
dotenv does not override variables that are already set, so the compose
value wins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-11 09:30:58 +02:00
twotalesanimation 9496c70155 Pass SHOTS_API_KEY through to the app container
Deploy / deploy (push) Failing after 2m19s
The import-shots feature calls review.twotalesvfx.com from a server
action that reads process.env.SHOTS_API_KEY. That variable existed only
in the local gitignored .env, and the compose file passed just
DATABASE_URL, NEXTAUTH_SECRET and NEXTAUTH_URL to the app service. In
production the key was therefore undefined, so the action threw before
issuing any request -- and because Next.js masks server-action errors in
production, the UI showed a generic failure that looked like a network
or CDN problem rather than missing configuration.

Interpolate SHOTS_API_KEY from the deploy environment instead of
hardcoding it, so the secret stays out of the repo. The :? guard makes
compose abort with an explanatory message when the variable is missing,
rather than silently starting an app that cannot import shots.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 13:54:30 +02:00
twotalesanimation 9dcf310806 User Access
Deploy / deploy (push) Successful in 2m3s
2026-08-18 15:23:22 +02:00
twotalesanimation 76ca160c90 Docker compose update
Deploy / deploy (push) Failing after 1s
2026-08-18 12:28:50 +02:00
twotalesanimation 95ed30812e Add full project files 2026-08-18 12:11:20 +02:00