added i_feed for Dockerfile;
This commit is contained in:
parent
881ef86181
commit
af5c419004
7
components/i_feed/Dockerfile
Normal file
7
components/i_feed/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM python:3.8-slim
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
RUN cd deps; ls; pip install dse-shared-libs-1.tar.gz;
|
||||||
|
ENTRYPOINT [ "python" ]
|
||||||
|
CMD [ "i_feed.py" ]
|
||||||
BIN
components/i_feed/deps/dse-shared-libs-1.tar.gz
Normal file
BIN
components/i_feed/deps/dse-shared-libs-1.tar.gz
Normal file
Binary file not shown.
27
components/i_feed/i_feed.py
Normal file
27
components/i_feed/i_feed.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import time
|
||||||
|
|
||||||
|
from traffic_light import TrafficLight, SWITCHING_TIME
|
||||||
|
from vehicle import Vehicle
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
tl1 = TrafficLight(tlid='traffic-light-1', switching_time=SWITCHING_TIME)
|
||||||
|
tl1.start()
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
tl2 = TrafficLight(tlid='traffic-light-2', switching_time=240)
|
||||||
|
tl2.start()
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
tl3 = TrafficLight(tlid='traffic-light-3', switching_time=360)
|
||||||
|
tl3.start()
|
||||||
|
|
||||||
|
v1 = Vehicle(vin='SB164ABN1PE082000')
|
||||||
|
v1.start_driving()
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
v2 = Vehicle(vin='SB999ABN1PE082111')
|
||||||
|
v2.start_driving()
|
||||||
|
|
||||||
|
time.sleep(0.5)
|
||||||
|
v3 = Vehicle(vin='SB555ABN1PE082555')
|
||||||
|
v3.start_driving()
|
||||||
Loading…
x
Reference in New Issue
Block a user