Closed mkao006 closed 8 years ago
The image was built successfully at bf0547dc556a829e18e9b9aa93112997771ad4e3.
We now need to understand how to point the web client to the container when it is running. Also the Nginx may not be configured correctly.
Also review the Dockerfile, check whether packages such as setuptools
are required and also maybe mount the static file in a different way.
Need to reconfigure the Dockerfile for postgres
The postgres/postgis reconfigured and installed in dc83a74718335415a62537beefc597404d7757c3
The build seems successful, but we need find how to point the client to the image when launched,
This answer shows how to host the container on local host http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
and maybe here http://blog.oddbit.com/2014/08/11/four-ways-to-connect-a-docker/
We can expose the port on the to the local host via
sudo docker run -d -p 8080:8000
However, it gave 502 bad gateway error suggesting that the uwsgi did not start.
After additional investigation, it would appear that the socket does not have the write permission. The owner group should have been set to www-data
appears to be root
, this means the connection can not be made I believe and resulted in the 502 gateway error.
Further, although there is a file called random_walker.sock
but the file type is -
instead of s
for socket. This might be another source of error.
The socket problem is fixed when running uwsgi directly
uwsgi --emperor /etc/uwsgi/sites --gid www-data&
but it seems the local host is still not connected to the docker container.
We have confirmed that the localhost can now connect with the Docker container, as we have mounted the logs which reflects the access. However, we have a new error.
2016/07/08 22:25:03 [error] 52#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 172.17.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///srv/random_walker/random_walker.sock:", host: "localhost:8080"
This bug is due to the uwsgi not luanched correctly. After installing the uwsgi plug in at 9b8f05db002f7e083f3891661f06d1185466a754 and also explicitly define the plugin at 01cb234e32557f94c8ac4506a1f8a3830496fc27 the uwsgi is serving the website correctly now.
The last implementation did not have the Random Walker Engine.
We will deploy with a single Docker container before using Docker Compose.