Rename working directory to microsoft-rewards-bot

This commit is contained in:
Obsidian
2025-11-10 21:58:52 +01:00
committed by GitHub
parent ee915de0eb
commit 66b37d8623

View File

@@ -3,7 +3,7 @@
############################################################################### ###############################################################################
FROM node:22-slim AS builder FROM node:22-slim AS builder
WORKDIR /usr/src/microsoft-rewards-script WORKDIR /usr/src/microsoft-rewards-bot
ENV PLAYWRIGHT_BROWSERS_PATH=0 ENV PLAYWRIGHT_BROWSERS_PATH=0
@@ -31,7 +31,7 @@ RUN npx playwright install --with-deps --only-shell chromium \
############################################################################### ###############################################################################
FROM node:22-slim AS runtime FROM node:22-slim AS runtime
WORKDIR /usr/src/microsoft-rewards-script WORKDIR /usr/src/microsoft-rewards-bot
# Set production environment variables # Set production environment variables
ENV NODE_ENV=production \ 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/* && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
# Copy compiled application and dependencies from builder stage # 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-bot/dist ./dist
COPY --from=builder /usr/src/microsoft-rewards-script/package*.json ./ COPY --from=builder /usr/src/microsoft-rewards-bot/package*.json ./
COPY --from=builder /usr/src/microsoft-rewards-script/node_modules ./node_modules 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=755 src/run_daily.sh ./src/run_daily.sh
COPY --chmod=644 src/crontab.template /etc/cron.d/microsoft-rewards-cron.template COPY --chmod=644 src/crontab.template /etc/cron.d/microsoft-rewards-cron.template
COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh 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 handles TZ, initial run toggle, cron templating & launch
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["sh", "-c", "echo 'Container started; cron is running.'"] CMD ["sh", "-c", "echo 'Container started; cron is running.'"]