-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error docker run from Dockerfile #20
Comments
This error is because we need to link the container running the app with a redis container |
I have attached the screenshots and three files as suggested template has<title>key value lookup service</title>app.py contains from flask import Flask, request, render_template @app.route('/', methods=['GET', 'POST']) key = default_key if request.method == 'POST' and request.form['submit'] == 'save': cache_value = None; return render_template('index.html', key=key, cache_value=cache_value) if name == 'main': Dockerfile contains FROM python:3.5 When I go to the browser and hit my localhost which is 192.168.0.101:5000, it says "The Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application." What is the solution? |
@pablorcruh any solution? |
I have an error running docker container, i don't have much experience using Docker and redis that is why i open this issue to ask for help
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 464, in _connect
socket.SOCK_STREAM):
File "/usr/local/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 572, in execute_command
connection.send_command(*args)
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
self.connect()
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -2 connecting to redis:6379. Name or service not known.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
sock = self._connect()
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 464, in _connect
socket.SOCK_STREAM):
File "/usr/local/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "app.py", line 7, in
cache.set(default_key, "one")
File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 1072, in set
return self.execute_command('SET', *pieces)
File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 578, in execute_command
connection.send_command(*args)
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
self.connect()
File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -2 connecting to redis:6379. Name or service not known.
The text was updated successfully, but these errors were encountered: