nginx + php + mysql + adminer
-
git clone https://github.com/rainjeck/hostdocker.git .
-
docker-compose build
-
docker-compose up -d
-
sudo chown -R <user>:www-data html && sudo chmod -R 777 html
-
Copy
php.ini
from fpm-container:docker cp <container_id>:/usr/local/etc/php/php.ini-production ./docker/php.ini
-
php settings:
date.timezone = Europe/Moscow session.gc_probability = 1 session.gc_divisor = 100 or 1000 session.gc_maxlifetime = 1440 max_input_time = 300 max_execution_time = 300 memory_limit = 1024M post_max_size = 100M upload_max_filesize = 90M
-
Uncomment option in
docker-compose.yml
-
Restart docker-compose
-
bash in container:
docker exec -it <container> sh
Host: mydev.dv
, localhost:5000
Adminer: localhost:8080
Use wordpress.sh
for downloading or:
-
Download latest version & unzip:
wget https://wordpress.org/latest.tar.gz && tar -xf latest.tar.gz
-
Rename
wp-config-sample.php
towp-config.php
mv wordpress/wp-config-sample.php wordpress/wp-config.php
-
Rename dir
wp-content
toassets
mv wordpress/wp-content wordpress/assets
-
Setup configuration in
wp-config.php
:define( 'WP_DEBUG_LOG', dirname(__FILE__) . '/_errors.log' ); define( 'WP_DEBUG_DISPLAY', false ); define( 'FS_METHOD', 'direct' ); define( 'WP_SITEURL', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}" ); define( 'WP_HOME', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}" ); define( 'WP_CONTENT_DIR', dirname(__FILE__) . '/assets' ); define( 'WP_CONTENT_URL', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}/assets" ); define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/assets/plugins' ); define( 'WP_PLUGIN_URL', "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}/assets/plugins" ); define( 'UPLOADS', 'assets/uploads' ); define( 'DISABLE_WP_CRON', true );
-
Rename dir
wordpress
tohtml
. -
Set permissions:
sudo chown -R <user>:www-data html && sudo chmod -R 777 html
Create link to theme folder:
ln -r -s html/assets/themes/<theme> <link_name>