Fix Docker deployment by resolving module resolution errors
continuous-integration/drone/push Build is passing

Update build process and imports to ensure Node.js ESM compatibility for Docker deployments, addressing ERR_MODULE_NOT_FOUND errors by separating server compilation and adding .js extensions to all relative imports.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ceced2fc-aa46-458d-ba87-ddd4b7bb1518
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/659922a9-0087-461c-90dd-6d9a58b81d4d/ceced2fc-aa46-458d-ba87-ddd4b7bb1518/SBF5OKZ
This commit is contained in:
paul-nothaft
2025-10-23 15:09:58 +00:00
parent e0512aa412
commit 6ff53e071a
7 changed files with 205 additions and 14 deletions
+3 -2
View File
@@ -17,8 +17,9 @@ COPY . .
# Build the client application
RUN npm run build
# Build server files separately (without bundling)
RUN npx esbuild server/index.ts server/routes.ts server/storage.ts server/db.ts server/static.ts --platform=node --packages=external --format=esm --outdir=dist
# Build server files separately (without bundling) - only production files
RUN npx esbuild server/index.ts server/routes.ts server/storage.ts server/db.ts server/static.ts \
--platform=node --packages=external --format=esm --outdir=dist
# Production stage
FROM base AS production