refactor: optimize Dockerfile to copy specific build artifacts for production
This commit is contained in:
@@ -12,7 +12,14 @@ FROM node:24-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app ./
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/drizzle ./drizzle
|
||||
# TODO: Need to generate schema outside of src during build to avoid copying all of src
|
||||
COPY --from=builder /app/src ./src
|
||||
COPY --from=builder /app/scripts ./scripts
|
||||
COPY --from=builder /app/drizzle.config.ts ./
|
||||
COPY --from=builder /app/package.json ./
|
||||
|
||||
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
||||
RUN chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
Reference in New Issue
Block a user