Added Docker
This commit is contained in:
parent
d97532c660
commit
b5087c636d
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
WORKDIR /checker
|
||||||
|
|
||||||
|
COPY package.json ./
|
||||||
|
COPY pnpm-lock.yaml ./
|
||||||
|
COPY src ./src
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.source=https://git.pfy.ch/pfych/chapter-tracker
|
||||||
|
LABEL org.opencontainers.image.description="Ping a webhook when a new MangaDex chapter is released"
|
||||||
|
LABEL org.opencontainers.image.licenses=MIT
|
||||||
|
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
RUN pnpm install
|
||||||
|
RUN pnpm run compile
|
||||||
|
|
||||||
|
CMD ["node", "./.out/build.js"]
|
14
README.md
14
README.md
@ -28,7 +28,6 @@ Create a `config.json` in the root directory of the project, or alongside the sc
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the config is set up you can run the script:
|
Once the config is set up you can run the script:
|
||||||
@ -36,3 +35,16 @@ Once the config is set up you can run the script:
|
|||||||
```shell
|
```shell
|
||||||
node .out/build.js # Or wherever the script is located
|
node .out/build.js # Or wherever the script is located
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
|
You can also run the script in a Docker container:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
checker:
|
||||||
|
image: git.pfy.ch/pfych/chapter-tracker:latest
|
||||||
|
volumes:
|
||||||
|
- "./config.json:/checker/config.json"
|
||||||
|
- "./mangaHistory.json:/checker/mangaHistory.json"
|
||||||
|
```
|
||||||
|
6
docker-compose.yml
Normal file
6
docker-compose.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
services:
|
||||||
|
checker:
|
||||||
|
image: git.pfy.ch/pfych/chapter-tracker:latest
|
||||||
|
volumes:
|
||||||
|
- "./config.json:/checker/config.json"
|
||||||
|
- "./mangaHistory.json:/checker/mangaHistory.json"
|
@ -23,6 +23,10 @@ void (async () => {
|
|||||||
};
|
};
|
||||||
}, {} as MangaByWebhook);
|
}, {} as MangaByWebhook);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Config loaded (${uniqueMangaIds.length} Manga, ${Object.keys(mangaByWebhook).length} Webhooks) `,
|
||||||
|
);
|
||||||
|
|
||||||
const checkForUpdates = async () => {
|
const checkForUpdates = async () => {
|
||||||
console.log('\nChecking for updates...');
|
console.log('\nChecking for updates...');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user