Guest User

Untitled

a guest
Jan 31st, 2019
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. # Attention!
  2. # This was written for example purposes and this
  3. # exact setup might not work in a real case scenario
  4.  
  5. version: '3'
  6.  
  7. services:
  8. nginx:
  9. image: nginx:latest
  10. environment:
  11. - NGINX_PORT=80
  12. - RUBY_HOST=ruby_app # Service name as host
  13. - PYTHON_HOST=python_app # Service name as host
  14. ports:
  15. - 80:80
  16. links:
  17. - ruby_app
  18. - python_app
  19.  
  20. python_app:
  21. build: . # Picture a Dockerfile setting up stuff
  22. command: python run.py
  23. environment:
  24. - DB_USER=postgres_user
  25. - DB_PASSWORD=postgres_password
  26. - DB_NAME=postgres_db
  27. - DB_HOST=postgres_service # Service name as host
  28. links:
  29. - postgres_service
  30.  
  31. ruby_app:
  32. build: . # Picture a Dockerfile setting up stuff
  33. command: ruby run.rb
  34. environment:
  35. - DB_USER=postgres_user
  36. - DB_PASSWORD=postgres_password
  37. - DB_NAME=postgres_db
  38. - DB_HOST=postgres_service # Service name as host
  39. links:
  40. - postgres_service
  41.  
  42. postgres_service:
  43. image: postgres:latest
  44. environment:
  45. - POSTGRES_DB=postgres_db
  46. - POSTGRES_USER=postgres_user
  47. - POSTGRES_PASSWORD=postgres_password
Add Comment
Please, Sign In to add comment