Advertisement
nejtr0n

rancher with external database

Feb 20th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. version: '2'
  2. services:
  3. rancher-server:
  4. image: 'rancher/server:stable'
  5. container_name: rancher-server
  6. restart: always
  7. volumes_from:
  8. - rancher-db
  9. ports:
  10. - "8080:8080"
  11. depends_on:
  12. - rancher-db
  13. environment:
  14. - CATTLE_DB_CATTLE_MYSQL_HOST=rancher-db
  15. - CATTLE_DB_CATTLE_MYSQL_PORT=3306
  16. - CATTLE_DB_CATTLE_MYSQL_NAME=rancher
  17. - CATTLE_DB_CATTLE_USERNAME=rancher
  18. - CATTLE_DB_CATTLE_PASSWORD=yourdbpassword
  19. rancher-db:
  20. image: mysql
  21. container_name: rancher-db
  22. restart: always
  23. volumes_from:
  24. - rancher-db-data
  25. ports:
  26. - "3306:3306"
  27. environment:
  28. - MYSQL_ROOT_PASSWORD=yourrootpasswd
  29. - MYSQL_DATABASE=rancher
  30. - MYSQL_USER=rancher
  31. - MYSQL_PASSWORD=yourdbpassword
  32. command: "--character-set-server=utf8 --collation-server=utf8_general_ci"
  33. rancher-db-data:
  34. container_name : rancher-db-data
  35. image: gliderlabs/alpine
  36. restart: always
  37. volumes:
  38. - ./rancher_data:/var/lib/mysql
  39. command: /bin/sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement