diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e547615 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,32 @@ +# Normalize line endings so the repo builds the same on Windows, macOS and Linux. +# +# Git for Windows installs with core.autocrlf=true by default, which rewrites +# checked-out files to CRLF. That is harmless for source we only ever compile, +# but fatal for anything the Docker images execute: a shell script whose shebang +# becomes "#!/bin/sh\r" fails at container start with +# exec /usr/local/bin/docker-entrypoint.sh: no such file or directory +# which names the file it just copied in and reads like the file is missing. +* text=auto + +# Scripts that run inside a Linux container must stay LF regardless of platform. +*.sh text eol=lf +docker-entrypoint.sh text eol=lf +Dockerfile text eol=lf +*.Dockerfile text eol=lf +.dockerignore text eol=lf + +# Lockfiles: keep LF so they don't churn across platforms. +package-lock.json text eol=lf + +# Binary assets — never touch these. +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.webp binary +*.woff binary +*.woff2 binary +*.ttf binary +*.otf binary +*.pdf binary diff --git a/backend/.dockerignore b/backend/.dockerignore index c048473..6f80bac 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -6,5 +6,15 @@ dist *.log .DS_Store Dockerfile +.dockerignore docker-compose.yml +docker-compose.tunnel.yml README.md +CLAUDE.md +# Deploy manifests for other targets — not needed inside the image. +fly.toml +railway.json +render.yaml +# Tracked, but only the runtime migrator (dist/migrate.js) runs in the image. +drizzle.config.ts +.env.example diff --git a/backend/Dockerfile b/backend/Dockerfile index 0e834a7..3ca40bd 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -19,7 +19,13 @@ RUN npm ci --omit=dev COPY --from=build /app/dist ./dist COPY --from=build /app/drizzle ./drizzle COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh -RUN chmod +x /usr/local/bin/docker-entrypoint.sh +# Strip CR before chmod. .gitattributes keeps this file LF on fresh clones, but +# a Windows checkout made before that existed still has CRLF on disk, and a +# "#!/bin/sh\r" shebang fails at container start with a "no such file or +# directory" error that names the file it just copied in. Cheap to make the +# image self-healing rather than rely on every contributor re-cloning. +RUN sed -i 's/\r$//' /usr/local/bin/docker-entrypoint.sh \ + && chmod +x /usr/local/bin/docker-entrypoint.sh EXPOSE 4000 # The entrypoint auto-generates any missing secrets, then we apply migrations # and start the API. diff --git a/frontend/.dockerignore b/frontend/.dockerignore index 83c7961..f4a6610 100644 --- a/frontend/.dockerignore +++ b/frontend/.dockerignore @@ -7,3 +7,6 @@ npm-debug.log* .DS_Store Dockerfile .dockerignore +tsconfig.tsbuildinfo +CLAUDE.md +AGENTS.md