Guest User

Untitled

a guest
Oct 27th, 2017
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. version: '2'
  2.  
  3. services:
  4. db:
  5. image: eg_postgresql
  6. expose:
  7. - 5432
  8. environment:
  9. - POSTGRES_PASSWORD=docker
  10. - POSTGRES_USER=docker
  11. - POSTGRES_DB=postgres
  12. web:
  13. build: .
  14. command: python3 manage.py runserver 0.0.0.0:8000
  15. volumes:
  16. - .:/test_application
  17. ports:
  18. - "8000:8000"
  19. links:
  20. - "db:db"
  21. environment:
  22. - DATABASE_URL=postgres://docker:docker@db:5432/postgres
  23. - DJANGO_SECRET_KEY=x7-g-xu^h5k%h8860!7ksn=@)7q9frn9_l6tmefvf)y=0)d!uh
  24.  
  25. conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
  26. django.db.utils.OperationalError: could not connect to server: Connection refused
  27. Is the server running on host "localhost" (127.0.0.1) and accepting
  28. TCP/IP connections on port 5432?
  29. could not connect to server: Cannot assign requested address
  30. Is the server running on host "localhost" (::1) and accepting
  31. TCP/IP connections on port 5432?
  32.  
  33. ubuntu@ip-172-31-7-117:~/dj1/helloworld$ sudo docker-compose ps
  34. Name Command State Ports
  35.  
  36. ----------------------------------------------------------------------------------
  37. helloworld_db_1 /usr/lib/postgresql/9.3/bi ... Up 5432/tcp
  38.  
  39. helloworld_web_1 python3 manage.py runserve ... Up 0.0.0.0:8000->8000/tcp
Add Comment
Please, Sign In to add comment