Sorry, but I still cant get it working here.
All the commands works and I get
$ docker exec -it cgwire cat /var/log/zou/gunicorn_error.log
[2018-04-14 19:48:00 +0000] [12] [INFO] Starting gunicorn 19.7.1
[2018-04-14 19:48:00 +0000] [12] [INFO] Listening at: http://127.0.0.1:5000 (12)
[2018-04-14 19:48:00 +0000] [12] [INFO] Using worker: gevent
[2018-04-14 19:48:00 +0000] [30] [INFO] Booting worker with pid: 30
[2018-04-14 19:48:00 +0000] [34] [INFO] Booting worker with pid: 34
[2018-04-14 19:48:00 +0000] [35] [INFO] Booting worker with pid: 35
But where do I go now in the browser?
Iāve tried http://localhost , http://localhost:80 , http://127.0.0.1:80 and http://127.0.0.1:5000 .
frank
April 15, 2018, 12:27pm
42
http://localhost , http://localhost:80 and http://127.0.0.1:80 should work. The API logs say that the API is up, so letās see if there is something wrong with Nginx (Nginx is the reverse proxy managing port redirection):
sudo docker exec -it cgwire cat /var/log/nginx/error.log
sudo docker exec -it cgwire cat /var/log/nginx/access.log
I donāt seem to get anything from those commands:
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire cat /var/log/nginx/error.log
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire cat /var/log/nginx/access.log
frank
April 15, 2018, 3:09pm
44
What returns the following command?
sudo docker exec -it cgwire ps -ef | grep nginx
We can try this too:
sudo docker exec -it cgwire pip install httpie
sudo docker exec -it cgwire http http://localhost:5000
sudo docker exec -it cgwire http http://localhost:80
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire ps -ef | grep nginx
root 16 9 1 19:37 ? 00:00:00 nginx: master process nginx -g d
www-data 19 16 0 19:37 ? 00:00:00 nginx: worker process
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire pip install httpie
Collecting httpie
Downloading httpie-0.9.9-py2.py3-none-any.whl (74kB)
100% |################################| 81kB 559kB/s
Collecting Pygments>=2.1.3 (from httpie)
Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
100% |################################| 849kB 452kB/s
Collecting requests>=2.11.0 (from httpie)
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
100% |################################| 92kB 1.4MB/s
Collecting certifi>=2017.4.17 (from requests>=2.11.0->httpie)
Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB)
100% |################################| 153kB 646kB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.11.0->httpie)
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |################################| 143kB 474kB/s
Collecting idna<2.7,>=2.5 (from requests>=2.11.0->httpie)
Downloading idna-2.6-py2.py3-none-any.whl (56kB)
100% |################################| 61kB 1.8MB/s
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.11.0->httpie)
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
100% |################################| 133kB 1.0MB/s
Installing collected packages: Pygments, certifi, chardet, idna, urllib3, requests, httpie
Successfully installed Pygments-2.2.0 certifi-2018.1.18 chardet-3.0.4 httpie-0.9.9 idna-2.6 requests-2.18.4 urllib3-1.22
You are using pip version 8.1.1, however version 10.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire http http://localhost:5000
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 45
Content-Type: application/json
Date: Sun, 15 Apr 2018 19:37:44 GMT
Server: gunicorn/19.7.1
{
"api": "Zou",
"version": "0.5.5"
}
admin@DESKTOP-O1ALUQI MINGW64 ~
$ docker exec -it cgwire http http://localhost:80
HTTP/1.1 200 OK
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html
Date: Sun, 15 Apr 2018 19:37:52 GMT
ETag: W/"5ac2c9d0-29c"
Last-Modified: Tue, 03 Apr 2018 00:24:48 GMT
Server: nginx/1.10.3 (Ubuntu)
Transfer-Encoding: chunked
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>CGWire - Easy Production Management</title><link rel=stylesheet type=text/css href=/static/css/font-awesome.css><link rel=stylesheet type=text/css href=/static/css/bulma.css><link href=/static/css/app.4ec83a3de9c4f6c45a39c6d1a90b9db5.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.3eeb1df5a0f6455eae37.js></script><script type=text/javascript src=/static/js/vendor.a552d10103228e741e8a.js></script><script type=text/javascript src=/static/js/app.8ca46141bcd15a3408aa.js></script></body></html>
frank
April 15, 2018, 8:55pm
46
Ok. So everything works fine, the only issue is the port mapping between the docker container and the host machine. Letās try to use another port (8000):
sudo docker run -d -p 8000:80 --name cgwire cgwire/cgwire
Then if you connect to http://localhost:8000 does it work?
No luck with switching the port unfortunately.
Iāll try on a different machine when I get to one. It may just be my Virtualbox/Docker setup on this machine that is causing issues.
frank
April 15, 2018, 9:26pm
48
Okā¦ Iām sad I canāt help you more.
Another option is that I setup a trial instance on our servers. What do you think about it?
Thanks for the option, but it was mostly to test out the issues I submitted. I not having much luck with Docker Toolbox on other machines either, so will need to test on Windows 10 machine without Virtualbox.
frank
April 16, 2018, 12:58pm
50
It seems to be a Windows issue. I found this long thread about it : https://github.com/moby/moby/issues/15740
Can you try to connect directly to the container IP? You can get the IP address with the following commands:
docker ps
docker inspect container_name | grep IPAddress
frank
April 16, 2018, 2:00pm
52
Congrats!
(Btw I published a new release yesterday. I think you can update your image)