Origami
Origami copied to clipboard
[Backend, Discussion]: Django channel support and Dockerfile deprecation.
The Dockerfile we are using does not work anymore, the reason being we are using python2.7 base image and using Django channels which is only supported by python 3.5 and above.
Docker builds thus fails in the current state, I haven't looked at any solution as of now. But one obvious solution here is upgrading python to 3.5 or above. And as far as I know the code is Python 3 compatible so there won't be any problem in migration.
@uttu357 @AvaisP any comments?
@AvaisP Can you look into this?
What error does it throw @fristonio ?
While building the docker image using docker-compose build
it throws the error
while installing channels
using pip. I tried installing pathlib
beforehand but it does no good installing async-timeout
which is a dependency of channels
. async-timeout
is only python 3 compatible.
@AvaisP
Install pathlib using a separate pip instruction before the uwsgi and channels installation. Try RUN pip install pathlib RUN pip install uwsgi channels
@fristonio Does this solves the issue?
Sorry, I don't know how I missed the comment from AvaisP. When I tried adding RUN pip install pathlib
as above after clearing the docker containers the install was successful. But there was some problem with django being able to communicate with postgres server. I have to figure it out now, will try to send the pull request as soon as I get it fixed. :)
Thanks for reminding me of this @uttu357
After building the image using docker-compose build
when I try to run a container I get the error
django_app_1 | connection = Database.connect(**conn_params)
django_app_1 | File "/usr/local/lib/python2.7/site-packages/psycopg2/__init__.py", line 130, in connect
django_app_1 | conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django_app_1 | django.db.utils.OperationalError: could not connect to server: Connection refused
django_app_1 | Is the server running on host "localhost" (127.0.0.1) and accepting
django_app_1 | TCP/IP connections on port 5432?
django_app_1 | could not connect to server: Cannot assign requested address
django_app_1 | Is the server running on host "localhost" (::1) and accepting
django_app_1 | TCP/IP connections on port 5432?
Is there some problem with docker-compose too or am I doing something wrong. As I have seen that when I run the container it opens all the ports required 5432 6379 and 8000
but still I get the above error.
@uttu357 @AvaisP
@fristonio is it still an issue?