mikeizbicki / cmc-csci143

big data course materials
40 stars 76 forks source link

cannot open my link in production dockerfile section even though docker ran successfully #434

Closed epaisano closed 9 months ago

epaisano commented 9 months ago

Hi!

I have been successful in opening my links in past sections. However, when I got to the end of the Production Dockerfile section of the tutorial, I was unable to open my link.

I was successful in running the following:

$ docker-compose -f docker-compose.prod.yml down -v
$ docker-compose -f docker-compose.prod.yml up -d --build
$ docker-compose -f docker-compose.prod.yml exec web python manage.py create_db

After which, I ran the following:

$ links http://localhost:6275

The port number, 6275, is the number in my docker-compose.prod.yml file. The error I am getting is:

Error loading http://localhost:6275: Connection refused

I thought it was maybe due to my ssh login info, but then I logged in with port forwarding and it was still not working. Does anyone have any idea what it might be?? Any help would be greatly appreciated--thanks!

mikeizbicki commented 9 months ago

The production config is a bit trickier than the development config because there are three different web programs that all need to work together correctly: flask, gunicorn and nginx. The problem is likely that somewhere a port is misspecified in the configuration related to gunicorn and nginx, since these are the two new services you've added for production. The most straightforward "fix" is to redo those configuration steps, paying careful attention to the ports as you go. Good luck :)