From 66b37d86234de2f723265792a408aa9b99abcb2f Mon Sep 17 00:00:00 2001 From: Obsidian <123307773+LightZirconite@users.noreply.github.com> Date: Mon, 10 Nov 2025 21:58:52 +0100 Subject: [PATCH] Rename working directory to microsoft-rewards-bot --- Dockerfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f50a04..e9ff066 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ############################################################################### FROM node:22-slim AS builder -WORKDIR /usr/src/microsoft-rewards-script +WORKDIR /usr/src/microsoft-rewards-bot ENV PLAYWRIGHT_BROWSERS_PATH=0 @@ -31,7 +31,7 @@ RUN npx playwright install --with-deps --only-shell chromium \ ############################################################################### FROM node:22-slim AS runtime -WORKDIR /usr/src/microsoft-rewards-script +WORKDIR /usr/src/microsoft-rewards-bot # Set production environment variables ENV NODE_ENV=production \ @@ -75,15 +75,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* # Copy compiled application and dependencies from builder stage -COPY --from=builder /usr/src/microsoft-rewards-script/dist ./dist -COPY --from=builder /usr/src/microsoft-rewards-script/package*.json ./ -COPY --from=builder /usr/src/microsoft-rewards-script/node_modules ./node_modules +COPY --from=builder /usr/src/microsoft-rewards-bot/dist ./dist +COPY --from=builder /usr/src/microsoft-rewards-bot/package*.json ./ +COPY --from=builder /usr/src/microsoft-rewards-bot/node_modules ./node_modules -# Copy runtime scripts with proper permissions from the start +# Copy runtime scripts with proper permissions and normalize line endings for non-Unix users COPY --chmod=755 src/run_daily.sh ./src/run_daily.sh COPY --chmod=644 src/crontab.template /etc/cron.d/microsoft-rewards-cron.template COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh +RUN sed -i 's/\r$//' /usr/local/bin/entrypoint.sh \ + && sed -i 's/\r$//' ./src/run_daily.sh # Entrypoint handles TZ, initial run toggle, cron templating & launch ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] -CMD ["sh", "-c", "echo 'Container started; cron is running.'"] \ No newline at end of file +CMD ["sh", "-c", "echo 'Container started; cron is running.'"]