-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (72 loc) · 1.87 KB
/
docker-compose.yml
File metadata and controls
77 lines (72 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: '3.8'
services:
mongodb:
image: mongo:7.0.14
container_name: nse-mongodb
environment:
MONGO_INITDB_DATABASE: nse_data
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
- mongodb_config:/data/configdb
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
networks:
- nse_network
restart: unless-stopped
scraper:
build:
context: .
dockerfile: Dockerfile
container_name: nse-scraper
depends_on:
mongodb:
condition: service_healthy
environment:
MONGODB_URI: mongodb://mongodb:27017/
MONGODB_DATABASE: nse_data
at_username: ${AT_USERNAME}
at_api_key: ${AT_API_KEY}
mobile_number: ${MOBILE_NUMBER}
volumes:
- ./nse_scraper:/app/nse_scraper
- ./httpcache:/app/httpcache
networks:
- nse_network
restart: unless-stopped
# For development, override with:
# command: crawl afx_scraper --loglevel=DEBUG
# To run notifications instead:
# command: python nse_scraper/stock_notification.py
# Optional: Scheduler for automated notifications (requires APScheduler)
# scheduler:
# build:
# context: .
# dockerfile: Dockerfile
# container_name: nse-scheduler
# depends_on:
# - mongodb
# environment:
# MONGODB_URI: mongodb://mongodb:27017/
# MONGODB_DATABASE: nse_data
# at_username: ${AT_USERNAME}
# at_api_key: ${AT_API_KEY}
# mobile_number: ${MOBILE_NUMBER}
# volumes:
# - ./nse_scraper:/app/nse_scraper
# networks:
# - nse_network
# restart: unless-stopped
# command: python nse_scraper/stock_notification.py
volumes:
mongodb_data:
driver: local
mongodb_config:
driver: local
networks:
nse_network:
driver: bridge