Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ dmypy.json

/data
*.json
!*.example.json

*.db.trace.db

Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# syntax=docker/dockerfile:1
FROM python:3.8.7-alpine

RUN apk add --no-cache gcc musl-dev linux-headers libffi-dev g++
RUN pip install --upgrade pip
COPY scraper_root /scraper/scraper_root

COPY scraper_root/requirements.txt /scraper/scraper_root/requirements.txt
RUN pip install -r /scraper/scraper_root/requirements.txt
COPY config*.json /scraper/

COPY scraper_root /scraper/scraper_root

WORKDIR /scraper
ENV PYTHONPATH "${PYTHONPATH}:/scraper"
CMD ["python3", "scraper_root/scraper.py"]
File renamed without changes.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ services:
scraper:
build: .
environment:
- CONFIG_FILE=/scraper/config.json
- CONFIG_FILE=/config/config.json
- DATABASE_PATH=sqlite:////data/exchanges_db.sqlite
volumes:
- $PWD/data:/data
- $PWD/config:/config
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
metabase-app:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml.example-second-dashboard
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ services:
scraper2:
build: .
environment:
- CONFIG_FILE=/scraper/config.json
- CONFIG_FILE=/config/config.json
- DATABASE_PATH=sqlite:////data/exchanges_db.sqlite
volumes:
- $PWD/data:/data
- $PWD/config:/config
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
metabase-app2:
Expand Down
2 changes: 1 addition & 1 deletion scraper_root/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
logger = logging.getLogger()

if __name__ == '__main__':
config_file_path = os.environ.get('CONFIG_FILE', 'config.json')
config_file_path = os.environ.get('CONFIG_FILE', '/config/config.json')
logger.info(f"Using config file {config_file_path}")
with open(config_file_path) as config_file:
user_config = hjson.load(config_file, object_hook=lambda d: SimpleNamespace(**d))
Expand Down