arshad75

docker-wordpress.yaml

Jul 4th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. version: '3.3'
  2. services:
  3. wordpress:
  4. depends_on:
  5. - db
  6. image: wordpress:latest
  7. volumes:
  8. - wordpress_files:/var/www/html
  9. networks:
  10. - wordpress
  11. ports:
  12. - "80:80"
  13. environment:
  14. WORDPRESS_DB_HOST: db:3306
  15. WORDPRESS_DB_USER: wordpress
  16. WORDPRESS_DB_PASSWORD: /run/secrets/my_wordpress_db_password
  17. db:
  18. image: mysql:5.7
  19. secrets:
  20. - db_root_password
  21. - db_dba_password
  22. - my_wordpress_db_password
  23. deploy:
  24. replicas: 1
  25. placement:
  26. constraints: [node.role == manager]
  27. resources:
  28. reservations:
  29. memory: 128M
  30. limits:
  31. memory: 256M
  32. ports:
  33. - "3306:3306"
  34. environment:
  35. MYSQL_ROOT_PASSWORD: /run/secrets/db_root_password
  36. MYSQL_DATABASE: wordpress
  37. MYSQL_USER: wordpress
  38. MYSQL_PASSWORD: /run/secrets/my_wordpress_db_password
  39. networks:
  40. - wordpress
  41. volumes:
  42. - /var/run/docker.sock:/var/run/docker.sock
  43. - type: bind
  44. source: /opt/docker/volumes/mysql
  45. target: /var/lib/mysql
  46. secrets:
  47. db_root_password:
  48. external: true
  49. db_dba_password:
  50. external: true
  51. my_wordpress_db_password:
  52. external: true
  53. volumes:
  54. wordpress_files:
  55. db_data:
  56.  
  57. networks:
  58. wordpress:
  59. external: true
Add Comment
Please, Sign In to add comment