Add base pyhton script for scraper
Correction into docker
This commit is contained in:
jeanGaston 2024-01-30 08:40:53 +01:00
parent 181b90f822
commit 926ebb6754
4 changed files with 19 additions and 6 deletions

View File

@ -5,10 +5,10 @@ FROM python:3.8-slim
WORKDIR /app WORKDIR /app
# Copy the script1.py and any other necessary files # Copy the script1.py and any other necessary files
COPY ./Helloworld.py /app/ COPY ./main.py /app/
# Install any dependencies # Install any dependencies
#RUN pip install --no-cache-dir -r ./requirements.txt RUN pip install --no-cache-dir bluepy.btle
# Set the entry point # Set the entry point
CMD ["python", "Helloworld.py"] CMD ["python", "main.py"]

View File

@ -1 +0,0 @@
print('HelloWorld')

16
DataScraper/main.py Normal file
View File

@ -0,0 +1,16 @@
from bluepy.btle import Scanner
scanner = Scanner()
print("Begin device scan")
while True:
devices = scanner.scan(timeout=3.0)
for device in devices:
print(
f"Device found {device.addr} ({device.addrType}), "
f"RSSI={device.rssi} dB"
)
for adtype, description, value in device.getScanData():
print(f" ({adtype}) {description} = {value}")

View File

@ -10,8 +10,6 @@ services:
build: build:
context: ./WebGui context: ./WebGui
dockerfile: ./DOCKERFILE dockerfile: ./DOCKERFILE
ports:
- '80:5000'
database: database:
image: 'mariadb:10.3' image: 'mariadb:10.3'