fix: copy compiled medusa-config.js for production runtime

This commit is contained in:
Nermin Karic
2026-11-22 23:13:23 +01:00
parent 45adcc2621
commit df9f8b3a7c
3 changed files with 30 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ ENV NODE_OPTIONS="--max-old-space-size=2048"
# Build Medusa backend and admin dashboard
RUN npm run build --workspace=@dtc/backend
# Copy compiled medusa-config.js and instrumentation.js to project root for production Node.js runtime
RUN cp apps/backend/.medusa/server/medusa-config.js apps/backend/medusa-config.js && \
if [ -f apps/backend/.medusa/server/instrumentation.js ]; then cp apps/backend/.medusa/server/instrumentation.js apps/backend/instrumentation.js; fi
# Prune devDependencies to keep image light and avoid OOM during copy
RUN npm prune --production --workspace=@dtc/backend