Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "2.3"
- services:
- db:
- image: mysql:5.7
- volumes:
- - db_data:/var/lib/mysql
- restart: always
- environment:
- MYSQL_ROOT_PASSWORD: somewordpress
- MYSQL_DATABASE: wordpress
- MYSQL_USER: wordpress
- MYSQL_PASSWORD: wordpress
- wordpress:
- depends_on:
- - db
- image: wordpress:latest
- ports:
- - 8000:80
- restart: always
- environment:
- WORDPRESS_DB_HOST: db:3306
- WORDPRESS_DB_NAME: wordpress
- WORDPRESS_DB_USER: wordpress
- WORDPRESS_DB_PASSWORD: wordpress
- WORDPRESS_TABLE_PREFIX: "wp_"
- WORDPRESS_DEBUG: 1
- # vstm: add shared volume
- volumes:
- - wp_data:/var/www/html
- - ./default/:/var/www/html/wp-content/themes/default
- wordpress-cli:
- depends_on:
- - db
- - wordpress
- image: wordpress:cli
- # vstm: This is required to run wordpress-cli with the same
- # user-id as wordpress. This way there are no permission problems
- # when running the cli
- user: xfs
- # vstm: The sleep 10 is required so that the command is run after
- # mysql is initialized. Depending on your machine this might take
- # longer or it can go faster.
- command: >
- /bin/bash -c '
- sleep 10;
- wp core install --path="/var/www/html" --url="http://localhost:8000" --title="Local Wordpress By Docker" --admin_user=admin --admin_password=secret --admin_email=foo@bar.com;
- wp plugin install classic-editor;
- '
- # vstm: add shared volume
- volumes:
- - wp_data:/var/www/html
- - ./default/:/var/www/html/wp-content/themes/default
- volumes:
- db_data:
- # vstm: add shared volume
- wp_data:
- Warning: Unable to create directory wp-content/uploads/2019/01. Is its parent directory writable by the server?
- Success: WordPress installed successfully.
- Installing Classic Editor (1.3)
- Warning: Failed to create directory '/etc/X11/fs/.wp-cli/cache/': mkdir(): Permission denied.
- Downloading installation package from https://downloads.wordpress.org/plugin/classic-editor.1.3.zip...
- Unpacking the package...
- Warning: Could not create directory.
- Error: No plugins installed.
Add Comment
Please, Sign In to add comment