Restore git-pull-only deploy: single compose path with schema from git
Deploy is back to the flow that worked: build dist locally, push, then on the server only `git pull` + `docker compose up -d --build`. The Dockerfile now also takes prisma/ and package.json from git and runs `prisma generate`, so schema and migration changes ship without rebuilding the 120MB node_modules bundle. Removes the prebuilt compose path, which could never work on a server without npm. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-1
@@ -9,10 +9,19 @@ COPY deploy-bundle.tar.gz /tmp/deploy-bundle.tar.gz
|
||||
RUN tar -xzf /tmp/deploy-bundle.tar.gz -C /app \
|
||||
&& rm /tmp/deploy-bundle.tar.gz
|
||||
|
||||
# dist و entrypoint از گیت — بدون بازسازی کل باندل
|
||||
# همهچیز جز node_modules از گیت میآید تا دیپلوی فقط با git pull انجام شود
|
||||
COPY package.json package-lock.json prisma.config.ts /app/
|
||||
COPY prisma /app/prisma
|
||||
COPY dist /app/dist
|
||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
RUN chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
# کلاینت Prisma باید با اسکیمای گیت همخوان شود؛ آفلاین است چون engine در باندل هست
|
||||
ENV CHECKPOINT_DISABLE=1
|
||||
ENV PRISMA_HIDE_UPDATE_MESSAGE=1
|
||||
# DATABASE_URL فقط برای بارگذاری prisma.config.ts لازم است، اتصالی برقرار نمیشود
|
||||
RUN DATABASE_URL="postgresql://build:build@localhost:5432/build?schema=public" \
|
||||
./node_modules/.bin/prisma generate
|
||||
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user