fix: force LF line endings so containers start on Windows checkouts (#11)

Cloning on Windows with core.autocrlf=true converted
frontend/docker-entrypoint.d/20-basic-auth.sh to CRLF. Inside the container
the kernel read the shebang as /bin/sh\r, found no such interpreter, and
nginx crashed with exit 127 in a restart loop, so `docker compose up` never
produced a working web container.

- .gitattributes: LF for everything Linux executes or parses
- frontend/Dockerfile: sed strips CR at build time, covering checkouts made
  before .gitattributes existed
This commit is contained in:
Pirnazar Muradov
2026-09-02 07:08:35 +08:00
committed by GitHub
parent 1e9506470f
commit c422fd1528
2 changed files with 37 additions and 1 deletions

31
.gitattributes vendored Normal file
View File

@@ -0,0 +1,31 @@
# Line ending normalisation.
#
# On Windows, git with core.autocrlf=true rewrites text files to CRLF on
# checkout. For files executed inside the Linux containers that is fatal: the
# shebang becomes "#!/bin/sh\r", the kernel looks for an interpreter literally
# named "/bin/sh\r", fails to find it, and the container dies with exit 127
# ("not found"). Keep the working tree on LF regardless of host OS.
* text=auto eol=lf
# Explicit — everything Linux executes or parses.
*.sh text eol=lf
*.envsh text eol=lf
Dockerfile text eol=lf
*.conf text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.ini text eol=lf
*.mako text eol=lf
.env.example text eol=lf
.dockerignore text eol=lf
# Leave binary assets alone.
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.webp binary
*.woff binary
*.woff2 binary
*.pdf binary