build(server): separater TS-Build für Server (server-dist) und Runtime auf Node JS statt ts-node; Dockerfile startet server-dist/index.js
This commit is contained in:
@@ -36,6 +36,7 @@ RUN pnpm install --frozen-lockfile --prod
|
||||
|
||||
# Copy built application from base stage
|
||||
COPY --from=base /app/dist ./dist
|
||||
COPY --from=base /app/server-dist ./server-dist
|
||||
|
||||
# Copy necessary files for runtime
|
||||
COPY --from=base /app/src/server/index.ts ./src/server/index.ts
|
||||
@@ -60,5 +61,5 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })" || exit 1
|
||||
|
||||
# Start the application with ts-node and dedicated tsconfig for NodeNext
|
||||
ENV TS_NODE_PROJECT=tsconfig.server.json
|
||||
CMD ["node", "--loader", "ts-node/esm", "src/server/index.ts"]
|
||||
# Start the precompiled server JS (kein ts-node im Runtime)
|
||||
CMD ["node", "server-dist/index.js"]
|
||||
|
Reference in New Issue
Block a user