Update
Add base pyhton script for scraper Correction into docker
This commit is contained in:
parent
181b90f822
commit
926ebb6754
@ -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"]
|
||||||
@ -1 +0,0 @@
|
|||||||
print('HelloWorld')
|
|
||||||
16
DataScraper/main.py
Normal file
16
DataScraper/main.py
Normal 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}")
|
||||||
|
|
||||||
@ -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'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user