Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

fix(docker): enforce LF line endings for entrypoint.sh (#1126) (#1172)

Jonathan Fishner8299484dfb5a
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..839df098
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+# Shell scripts must keep LF endings or containers fail with
+# "exec /entrypoint.sh: no such file or directory" (#1126)
+*.sh text eol=lf
+default.conf.template text eol=lf
diff --git a/Dockerfile b/Dockerfile
index 10852414..3b3b98d4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -27,7 +27,8 @@ FROM nginx:stable-alpine AS production
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
COPY ./default.conf.template /etc/nginx/conf.d/default.conf.template
COPY entrypoint.sh /entrypoint.sh
-RUN chmod +x /entrypoint.sh
+# Strip CRLF in case the repo was checked out on Windows (#1126)
+RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
EXPOSE 80