Fix Docker build: move entrypoint out of excluded deploy/ dir
.dockerignore excludes deploy/ entirely. The entrypoint script lived there, so the COPY in Stage 3 failed with "not found". Move it to the project root (alongside Dockerfile) where the build context includes it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
01945fbd0a
commit
bb3a770cf3
+1
-1
@@ -36,7 +36,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
# drizzle-orm + postgres which Next.js standalone already traces in.
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/drizzle ./drizzle
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts/migrate.mjs ./scripts/migrate.mjs
|
||||
COPY --chown=nextjs:nodejs deploy/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
COPY --chown=nextjs:nodejs docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
USER nextjs
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "${RUN_MIGRATIONS:-true}" = "true" ]; then
|
||||
echo "running migrations..."
|
||||
node /app/scripts/migrate.mjs
|
||||
else
|
||||
echo "skipping migrations (RUN_MIGRATIONS=$RUN_MIGRATIONS)"
|
||||
fi
|
||||
|
||||
exec node /app/server.js
|
||||
Reference in New Issue
Block a user