Скриншот браузера
У меня есть 2 док-контейнера, работающих под управлением mongo: 3.0.3 и python: 2.7. И у меня есть app.py, который подключается к экземпляру mongodb. В моем app.py я использовал порт 5000 для сопоставления 27017. app.py работает нормально, но когда я захожу на http://0.0.0.0:5000 это соединение отказано, ошибка приходит на терминал.
172.17.0.1 - - [01/Jul/2018 10:01:32] "GET / HTTP/1.1" 500 -
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/pythonApp/app.py", line 16, in form
if posts.count()!=0:
File "/usr/local/lib/python2.7/site-packages/pymongo/collection.py", line 1023, in count
return self._count(cmd)
File "/usr/local/lib/python2.7/site-packages/pymongo/collection.py", line 985, in _count
with self._socket_for_reads() as (sock_info, slave_ok):
File "/usr/local/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 699, in _socket_for_reads
with self._get_socket(read_preference) as sock_info:
File "/usr/local/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 663, in _get_socket
server = self._get_topology().select_server(selector)
File "/usr/local/lib/python2.7/site-packages/pymongo/topology.py", line 121, in select_server
address))
File "/usr/local/lib/python2.7/site-packages/pymongo/topology.py", line 97, in select_servers
self._error_message(selector))
ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
Я не могу найти файлы .conf, так как это контейнер. Есть идеи, как это исправить? : /
изображение моего докера https://hub.docker.com/r/sizijay/dockerexercise/
см. подробное описание dockerfile