Skip to content

Commit 9b84947

Browse files
committed
Updated 2022 version
1 parent b426812 commit 9b84947

File tree

13 files changed

+1523
-482
lines changed

13 files changed

+1523
-482
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
2-
node_modules/
2+
node_modules/
3+
dist/

Dockerfile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
FROM node:16-slim
1+
FROM node:20-slim
2+
3+
# We don't need the standalone Chromium
4+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
5+
6+
# Install Google Chrome Stable and fonts
7+
# Note: this installs the necessary libs to make the browser work with Puppeteer.
8+
RUN apt-get update && apt-get install gnupg wget -y && \
9+
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
10+
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
11+
apt-get update && \
12+
apt-get install google-chrome-stable fonts-noto-color-emoji -y --no-install-recommends && \
13+
rm -rf /var/lib/apt/lists/*
214

315
WORKDIR /usr/src/app
416

5-
COPY package*.json .
6-
COPY index.js .
7-
COPY .env .
17+
COPY . .
18+
19+
RUN yarn install --frozen-lockfile
820

9-
RUN npm install
21+
RUN yarn build
1022

11-
CMD [ "node", "index.js" ]
23+
CMD [ "yarn", "start" ]

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
Originally by [Martin Hanzlowsky](https://github.com/marwuint)
44

5+
Updated by [Matic Babnik](https://github.com/MaticBabnik)
6+
57
## Enviromental variables
68

79
Supports `.env` files.
810

911
```
10-
WEBHOOK_ID=...
11-
WEBHOOK_TOKEN=...
12-
LEADERBOARD_URL=...
12+
WEBHOOK_URL=...
13+
LEADERBOARD_ID=...
1314
SESSION_ID=...
1415
```
1516

@@ -18,11 +19,14 @@ SESSION_ID=...
1819
### Simple
1920

2021
```sh
21-
# One time installation
22-
npm install
22+
# Install dependencies
23+
yarn
24+
25+
# Build
26+
yarn build
2327

2428
# Start
25-
npm start
29+
yarn start
2630
```
2731

2832
### Docker

index.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)