.dockerignore excludes .git/, so COPY . $APP_DIR never copies the .git
directory into the image. The RUN step at line 231 ran git clean -xdf
unconditionally, which requires a git repository — failing with
'fatal: not a git repository'.
Wrap git clean and rm -rf .git in a conditional that checks for .git
directory existence first, falling through silently when absent.
ISSUES CLOSED: #1233