Archived
1
0
Fork 0

Add Dockerfile

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2021-03-09 10:55:44 +01:00
parent f7d10a00e5
commit 21e40e9079
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7
2 changed files with 36 additions and 10 deletions

11
Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM golang:1.16-alpine
WORKDIR /src/
COPY * /src/
RUN apk add --update alpine-sdk \
&& make \
&& mv bin/restockbot /usr/local/bin/restockbot \
&& rm -rf /src/*
WORKDIR /root/

View file

@ -22,20 +22,15 @@ Follow [this procedure](https://github.com/jouir/twitter-login) to generate all
* `access_token`
* `access_token_secret`
## Installation
## Compilation
### With pre-built binaries
Download the latest [release](https://github.com/jouir/restockbot/releases).
Ensure checksums are identical.
Then execute the binary:
```
./restockbot -version
./restockbot -help
```
## Compilation
### With make
Clone the repository:
```
@ -60,6 +55,12 @@ Eventually remove produced binaries with:
make clean
```
### With Docker
```
docker image build -t restockbot:$(cat VERSION) .
```
## Configuration
Default file is `restockbot.json` in the current directory. The file name can be passed with the `-config` argument.
@ -77,6 +78,20 @@ Options:
* `exclude_regex` (optional): exclude products with a name matching this regexp
* `browser_address` (optional): set headless browser address (ex: `http://127.0.0.1:9222`)
## Usage
### With binary
```
restockbot -help
```
### With Docker
```
docker run -it --name restockbot --rm --link chromium:chromium -v $(pwd):/root/ restockbot:$(cat VERSION) restockbot -help
```
## How to contribute
Lint the code with pre-commit:
@ -166,4 +181,4 @@ Products will then be parsed.
## Disclaimer
Crawling a website should be used with caution. Please check with retailers if the bot respects the terms of use for their websites. Authors of the bot are not responsible of the bot usage.
Crawling a website should be used with caution. Please check with retailers if the bot respects the terms of use for their websites. Authors of the bot are not responsible of the bot usage.