mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-11 19:06:18 +00:00
12
Dockerfile
12
Dockerfile
@@ -24,17 +24,23 @@ RUN apt-get install -y \
|
|||||||
# Install application dependencies
|
# Install application dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Ensure correct permissions for node_modules
|
||||||
|
RUN chmod -R 755 /usr/src/microsoft-rewards-script/node_modules
|
||||||
|
|
||||||
|
# Install Playwright Chromium directly from local node_modules
|
||||||
|
RUN ./node_modules/.bin/playwright install chromium
|
||||||
|
|
||||||
# Build the script
|
# Build the script
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Install playwright chromium
|
|
||||||
RUN npx playwright install chromium
|
|
||||||
|
|
||||||
# Copy cron file to cron directory
|
# Copy cron file to cron directory
|
||||||
COPY src/crontab.template /etc/cron.d/microsoft-rewards-cron.template
|
COPY src/crontab.template /etc/cron.d/microsoft-rewards-cron.template
|
||||||
|
|
||||||
# Create the log file to be able to run tail
|
# Create the log file to be able to run tail
|
||||||
RUN touch /var/log/cron.log
|
RUN touch /var/log/cron.log
|
||||||
|
|
||||||
|
# Ensure correct permissions for the working directory
|
||||||
|
RUN chmod -R 755 /usr/src/microsoft-rewards-script
|
||||||
|
|
||||||
# Define the command to run your application with cron optionally
|
# Define the command to run your application with cron optionally
|
||||||
CMD sh -c 'node src/updateConfig.js && echo "$TZ" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata && if [ "$RUN_ON_START" = "true" ]; then npm start; fi && envsubst < /etc/cron.d/microsoft-rewards-cron.template > /etc/cron.d/microsoft-rewards-cron && crontab /etc/cron.d/microsoft-rewards-cron && cron && tail -f /var/log/cron.log'
|
CMD sh -c 'node src/updateConfig.js && echo "$TZ" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata && if [ "$RUN_ON_START" = "true" ]; then npm start; fi && envsubst < /etc/cron.d/microsoft-rewards-cron.template > /etc/cron.d/microsoft-rewards-cron && crontab /etc/cron.d/microsoft-rewards-cron && cron && tail -f /var/log/cron.log'
|
||||||
|
|||||||
Reference in New Issue
Block a user