chore: update package manager to bun@1.3.5 and streamline Dockerfile by removing unnecessary user creation and ownership settings, enhancing build efficiency

This commit is contained in:
2026-01-09 16:24:38 -03:00
parent 8a97d236a6
commit fb22f82ce6
8 changed files with 237 additions and 220 deletions

View File

@@ -35,21 +35,17 @@ FROM oven/bun:1-slim AS production
# Set working directory to match builder structure
WORKDIR /app
# Create non-root user
RUN addgroup --system --gid 1001 sveltekit
RUN adduser --system --uid 1001 sveltekit
# Copy root node_modules (contains hoisted dependencies)
COPY --from=builder --chown=sveltekit:sveltekit /app/node_modules ./node_modules
COPY --from=builder /app/node_modules ./node_modules
# Copy built application and workspace files
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/build ./apps/web/build
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/package.json ./apps/web/package.json
COPY --from=builder /app/apps/web/build ./apps/web/build
COPY --from=builder /app/apps/web/package.json ./apps/web/package.json
# Copy workspace node_modules (contains symlinks to root node_modules)
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/node_modules ./apps/web/node_modules
COPY --from=builder /app/apps/web/node_modules ./apps/web/node_modules
# Copy any additional files needed for runtime
COPY --from=builder --chown=sveltekit:sveltekit /app/apps/web/static ./apps/web/static
COPY --from=builder /app/apps/web/static ./apps/web/static
# Switch to non-root user
USER sveltekit