Я создал свой собственный образ докера orientdb csodb: 1.0, который связан с моей докернизированной версией приложения python.
Когда я пытаюсь запустить образ csodb: 1.0, используя sudo docker run -p2424: 2424 -p 2480: 2480 --net = "host" -it csodb: 1.0 , я могу получить доступ к orientdb http://localhost:2480/studio/index.html.
Это мой docker-compose.yaml
version: '3'
services:
csodb:
image: csodb:1.0
network_mode: "host"
ports:
- 2480:2480
- 2424:2424
python-backend:
build: ./python-backend
ports:
- "8023:8023"
links:
- "csodb:database"
Когда я запускаю свое приложение с помощью docker-compose up, я получаю
python-backend_1 | client.connect(setting.ODB_NAME, setting.ODB_PWD)
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/orient.py", line 325, in connect
python-backend_1 | return self.get_message("ConnectMessage") \
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/orient.py", line 540, in get_message
python-backend_1 | message_instance = _Message(self._connection)\
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/messages/connection.py", line 17, in __init__
python-backend_1 | super( ConnectMessage, self ).__init__(_orient_socket)
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/messages/base.py", line 24, in __init__
python-backend_1 | sock.get_connection()
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/orient.py", line 78, in get_connection
python-backend_1 | self.connect()
python-backend_1 | File "/usr/local/lib/python3.6/dist-packages/pyorient/orient.py", line 107, in connect
python-backend_1 | raise PyOrientConnectionException( "Socket Error: %s" % e, [] )
python-backend_1 | pyorient.exceptions.PyOrientConnectionException: Socket Error: [Errno -2] Name or service not known