-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed typos - Added Dockerfile (experimental) - Increased scroll amount
- Loading branch information
Showing
5 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Use an official Node.js runtime as a base image | ||
FROM node:18 | ||
|
||
# Set the working directory in the container | ||
WORKDIR /usr/src/microsoft-rewards-script | ||
|
||
# Install jq | ||
RUN apt-get update && apt-get install -y jq | ||
|
||
|
||
# Copy all files to the working directory | ||
COPY . . | ||
|
||
# Check if "headless" is set to "true" in the config.json file | ||
RUN HEADLESS=$(cat src/config.json | jq -r .headless) \ | ||
&& if [ "$HEADLESS" != "true" ]; then \ | ||
echo "Error: 'headless' in src/config.json is not true."; \ | ||
exit 1; \ | ||
fi | ||
|
||
# Install dependencies including Playwright | ||
RUN apt-get install -y \ | ||
xvfb \ | ||
libgbm-dev \ | ||
libnss3 \ | ||
libasound2 \ | ||
libxss1 \ | ||
libatk-bridge2.0-0 \ | ||
libgtk-3-0 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install application dependencies | ||
RUN npm install | ||
|
||
# Build the script | ||
RUN npm run build | ||
|
||
# Install playwright chromium | ||
RUN npx playwright install chromium | ||
|
||
# Define the command to run your application | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters