Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. install Docker and Docker-compose using command below
- # apt install docker.io docker-compose -y
- 2. make directory
- # mkdir wp
- # cd wp
- 3. Create Dockerfiles
- # nano docker-compose.yaml
- 4. Insert Script Below
- --------------------------------------------------------------------------------------------
- version: '3.8'
- services:
- wordpress:
- image: wordpress:latest
- ports:
- - "80:80"
- environment:
- WORDPRESS_DB_HOST: db
- WORDPRESS_DB_NAME: wordpress_db
- WORDPRESS_DB_USER: wordpress_user
- WORDPRESS_DB_PASSWORD: your_strong_password
- volumes:
- - ./wordpress_data:/var/www/html
- depends_on:
- - db
- db:
- image: "mysql:5.7"
- environment:
- MYSQL_ROOT_PASSWORD: your_root_password
- MYSQL_DATABASE: wordpress_db
- MYSQL_USER: wordpress_user
- MYSQL_PASSWORD: your_strong_password
- volumes:
- - ./db_data:/var/lib/mysql
- -------------------------------------------------------------------------------------------------
- 5. Execute Command below
- # docker-compose up -d
- 6. Using any Browser and locate
- http://ip
- 7. Configure Wordpress and Done. !
- ---------------------------------------------------------------------------------------------------
- if counter error of :
- The uploaded file exceeds the upload_max_filesize directive in php.ini.
- solution
- # docker container exec -it 9ddd9bded663 bash -c "echo 'php_value upload_max_filesize 256M' > '/var/www/html/.htaccess'"
- note : 9ddd9bded663 is container ID
- sumber : https://forums.docker.com/t/how-to-get-access-to-php-ini-file/68986
- ----------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment