Ensure shared schema is compiled for production deployment
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Update Dockerfile and build process to compile shared/schema.ts using esbuild and copy the resulting schema.js to the production image. 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:
+4
-1
@@ -21,6 +21,9 @@ RUN npm run build
|
||||
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 shared schema file
|
||||
RUN npx esbuild shared/schema.ts --platform=node --packages=external --format=esm --outdir=shared
|
||||
|
||||
# Production stage
|
||||
FROM base AS production
|
||||
|
||||
@@ -29,7 +32,7 @@ COPY --from=dependencies /tmp/prod_node_modules ./node_modules
|
||||
|
||||
# Copy built application
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/shared ./shared
|
||||
COPY --from=build /app/shared/schema.js ./shared/
|
||||
COPY --from=build /app/drizzle.config.ts ./
|
||||
COPY --from=build /app/package.json ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user