mirror of https://github.com/Askill/r_place.git
clients dockerfile
This commit is contained in:
parent
a10a7341fc
commit
b385990c84
|
|
@ -0,0 +1,10 @@
|
|||
FROM python:3.10
|
||||
ENV TARGET=localhost:8080
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "python", "clients.py" ]
|
||||
|
|
@ -89,6 +89,7 @@ async def sender(target, img):
|
|||
return
|
||||
except websockets.ConnectionClosed:
|
||||
print("reconnecting")
|
||||
continue
|
||||
|
||||
|
||||
async def client(target):
|
||||
|
|
@ -129,4 +130,5 @@ def asyncMain(x, target):
|
|||
if __name__ == "__main__":
|
||||
# with Pool(12) as p:
|
||||
# print(p.map(asyncMain, [() for _ in range(12)]))
|
||||
asyncMain(0, target="ws://venus:8080")
|
||||
asyncMain(0, target="ws://" + os.getenv("TARGET", "venus:8080"))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue