diff --git a/Dockerfile b/Dockerfile index 64ee9ea..e28c678 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,11 @@ RUN ls -d /opt/venv/lib/python*/site-packages/nvidia/cublas/lib \ # Heavy layer (torch CPU + transformers + MeCab); placed before the app # COPY so it stays cached across source-only changes. --- COPY docker/setup-melo.sh /app/docker/setup-melo.sh -RUN bash /app/docker/setup-melo.sh +# Strip CR before running: a Windows checkout (autocrlf) yields CRLF, which makes +# bash read line 18 as `set -euxo pipefail\r` and abort with +# "set: pipefail: invalid option name". .gitattributes pins *.sh to LF, but this +# keeps the build working even on a not-yet-renormalised working tree. +RUN sed -i 's/\r$//' /app/docker/setup-melo.sh && bash /app/docker/setup-melo.sh # --- Human input + window management for the on-screen Chrome control tool. # Placed AFTER the heavy melo layer so it doesn't bust that cache. xdotool @@ -81,6 +85,11 @@ RUN cd /app/bot && bun install --frozen-lockfile || bun install COPY . /app WORKDIR /app +# Normalise all container shell scripts to LF. On a Windows checkout (autocrlf) +# these arrive as CRLF, which would break their shebangs at runtime (entrypoint, +# run-*.sh) the same way it broke setup-melo.sh at build time. +RUN find /app/docker /app/scripts -name '*.sh' -exec sed -i 's/\r$//' {} + + # --- Default Piper voice (best-effort at build; entrypoint retries if absent) --- RUN bash docker/download-piper.sh || true