FaLee

2025-09-01 - Create Wodpress Docker Using Docker Compose

Sep 1st, 2025 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. 1. install Docker and Docker-compose using command below
  2. # apt install docker.io docker-compose -y
  3.  
  4. 2. make directory
  5. # mkdir wp
  6. # cd wp
  7.  
  8. 3. Create Dockerfiles
  9. # nano docker-compose.yaml
  10.  
  11. 4. Insert Script Below
  12.  
  13. --------------------------------------------------------------------------------------------
  14. version: '3.8'
  15. services:
  16. wordpress:
  17. image: wordpress:latest
  18. ports:
  19. - "80:80"
  20. environment:
  21. WORDPRESS_DB_HOST: db
  22. WORDPRESS_DB_NAME: wordpress_db
  23. WORDPRESS_DB_USER: wordpress_user
  24. WORDPRESS_DB_PASSWORD: your_strong_password
  25. volumes:
  26. - ./wordpress_data:/var/www/html
  27. depends_on:
  28. - db
  29. db:
  30. image: "mysql:5.7"
  31. environment:
  32. MYSQL_ROOT_PASSWORD: your_root_password
  33. MYSQL_DATABASE: wordpress_db
  34. MYSQL_USER: wordpress_user
  35. MYSQL_PASSWORD: your_strong_password
  36. volumes:
  37. - ./db_data:/var/lib/mysql
  38. -------------------------------------------------------------------------------------------------
  39. 5. Execute Command below
  40. # docker-compose up -d
  41.  
  42. 6. Using any Browser and locate
  43. http://ip
  44.  
  45. 7. Configure Wordpress and Done. !
  46.  
  47.  
  48. ---------------------------------------------------------------------------------------------------
  49. if counter error of :
  50. The uploaded file exceeds the upload_max_filesize directive in php.ini.
  51.  
  52. solution
  53. # docker container exec -it 9ddd9bded663 bash -c "echo 'php_value upload_max_filesize 256M' > '/var/www/html/.htaccess'"
  54. note : 9ddd9bded663 is container ID
  55.  
  56. sumber : https://forums.docker.com/t/how-to-get-access-to-php-ini-file/68986
  57. ----------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment