ports fix
This commit is contained in:
parent
e1441af9a3
commit
a33dc0dee0
@ -26,14 +26,24 @@ def profile_start_up(sender, user, request, **kwargs):
|
||||
session = Session()
|
||||
session.user = user
|
||||
session.sessionid = request.COOKIES.get('sessionid')
|
||||
# TODO metoda wybierania portów
|
||||
port = 6969
|
||||
session.port = port
|
||||
|
||||
# Create container
|
||||
docker_manager = DockerManager()
|
||||
container_id = docker_manager.turn_on_container(user.volume, port)
|
||||
|
||||
# TODO metoda wybierania portów
|
||||
port = 6969
|
||||
container_id = -1
|
||||
while True:
|
||||
try:
|
||||
container_id = docker_manager.turn_on_container(user.volume, port)
|
||||
break
|
||||
# TODO dodać konkret bledy
|
||||
except:
|
||||
port += 1
|
||||
|
||||
session.port = port
|
||||
session.container_id = container_id
|
||||
|
||||
session.save()
|
||||
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
import docker
|
||||
|
||||
|
||||
client = docker.from_env()
|
Loading…
Reference in New Issue
Block a user