Skip to content

Conversation

@sihyeonn
Copy link

@sihyeonn sihyeonn commented Dec 11, 2025

Summary

  • Optimize debian-dev/Dockerfile and debian-dev/Dockerfile.local for better Docker layer caching
  • Copy only dependency-related files before full source code to improve cache hits on code changes

Changes

Layer Caching Optimization

  • Dockerfile.local: Separate COPY steps - first copy Makefile, rockspec, .requirements, then run make deps, finally copy remaining source code
  • This ensures make deps layer is cached when only application code changes

Brotli Build Improvement

  • Move brotli compilation into Dockerfile as separate RUN layer (cached independently)
  • Copy pre-built brotli from build stage instead of rebuilding in production stage

Cleanup

  • Remove duplicate apt-get install libldap2-dev in production stage
  • Fix ENV syntax (DEBIAN_FRONTEND=noninteractive instead of DEBIAN_FRONTEND noninteractive)

Benefits

  • Faster rebuilds: Code-only changes no longer trigger full dependency reinstallation
  • Smaller final image: Brotli build tools not installed in production stage
  • Simpler maintenance: No external shell script dependency

@sihyeonn sihyeonn force-pushed the feat/sh-improve-dockerfile branch 2 times, most recently from e992a99 to 0bd10fa Compare December 12, 2025 00:27
- Separate build dependencies, brotli build, and apisix installation
  into distinct layers for improved caching
- Copy dependency files (Makefile, rockspec, .requirements) before
  source code to cache deps layer on code changes
- Remove duplicate apt-get installations in production stage

Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
@sihyeonn sihyeonn force-pushed the feat/sh-improve-dockerfile branch from 0bd10fa to c7328cb Compare December 12, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant