Skip to content

fix: add backend .dockerignore and fix build stage dependencies#908

Open
Doiae9 wants to merge 1 commit into
LabsCrypt:mainfrom
Doiae9:fix/backend-dockerignore
Open

fix: add backend .dockerignore and fix build stage dependencies#908
Doiae9 wants to merge 1 commit into
LabsCrypt:mainfrom
Doiae9:fix/backend-dockerignore

Conversation

@Doiae9

@Doiae9 Doiae9 commented Jun 27, 2026

Copy link
Copy Markdown

Summary of Contributions

1. Optimized Docker Build Context

  • Added backend/.dockerignore: Excluded heavy and sensitive directories/files (such as node_modules, dist, coverage, .env*, *.log, and src/generated) from being sent to the Docker daemon. This significantly drops the build context size and mitigates the risk of leaking sensitive environment variables into the build layers.

2. Fixed Backend Dockerfile Multi-Stage Build

  • Dependency Resolution: Adjusted the builder stage to execute a full npm install instead of restricting dev dependencies. This ensures that essential CLI tools required for compilation (like TypeScript and Prisma) are fully available during the build phase.
  • Prisma Schema Inclusion: Added the COPY prisma ./prisma directive into the builder stage to resolve a critical build failure where the compilation script could not locate the required database schema file.
  • Production Optimization: Maintained the --omit=dev flag in the final runner stage to keep the production container image as lightweight, secure, and lean as possible.

@ogazboiz

ogazboiz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

your branch is green, but it went conflicting after the ci fixes landed on main: #969 and #974 touched backend/Dockerfile and backend/src/workers/soroban-event-worker.ts, which this pr also edits. please rebase on main and it should be good to go: git fetch origin && git rebase origin/main && git push --force-with-lease. if any of your Dockerfile or soroban-event-worker changes overlap what #969 already did (copying prisma/ into the runner, and the import type { Prisma } from '../generated/prisma' fix), drop those now-redundant bits and keep just your actual change. i'll re-review and merge once it's rebased and ci is green.

@Doiae9 Doiae9 force-pushed the fix/backend-dockerignore branch from 8374d6a to 68bc7c0 Compare July 2, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants