Optimized Dockerfile for multi-stage builds