mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
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:
@@ -12,7 +12,12 @@ RUN apk add --no-cache openssl
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY docker-entrypoint.d/20-basic-auth.sh /docker-entrypoint.d/20-basic-auth.sh
|
||||
RUN chmod +x /docker-entrypoint.d/20-basic-auth.sh \
|
||||
# sed strips any stray CR: cloned on Windows with core.autocrlf=true the
|
||||
# script arrives as CRLF, the kernel reads the shebang as "/bin/sh\r", and
|
||||
# nginx dies on boot with "not found" (exit 127). .gitattributes fixes this
|
||||
# at the repository level; this line covers checkouts that predate it.
|
||||
RUN sed -i 's/\r$//' /docker-entrypoint.d/20-basic-auth.sh \
|
||||
&& chmod +x /docker-entrypoint.d/20-basic-auth.sh \
|
||||
&& touch /etc/nginx/basic-auth.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user