|
|
пре 5 месеци | |
|---|---|---|
| configs | пре 4 година | |
| deployment | пре 4 година | |
| plugins | пре 2 година | |
| vue-theme | пре 5 месеци | |
| .drone.yml | пре 3 година | |
| .gitignore | пре 2 година | |
| README.md | пре 2 година | |
| adminer.ini | пре 5 година | |
| docker-compose.yml | пре 4 година | |
| reset-db.sh | пре 5 година | |
| sample.env | пре 5 година | |
| uploads.ini | пре 4 година |
Docker + Wordpress for SPEED
brew install node using Homebrewapt install nodejs (see Ubuntu/Debian specific instructions) or pacman -S nodejs (Arch Linux)git clone ssh://git@gitea.yvvas.com:4022/craft-in-america/vue-wp.gitcd vue-wpsample.env file to .env and substitute the variables with your owndocker-compose up -dhttp://localhost:8080 and complete the Wordpress installercd vue-themenpm installThe initial Wordpress installation does not include any content or user data beyond the default, so we’ll need to adjust some settings before we can use our custom theme.
Appearance > ThemesPlugins. You should activate craft-endpoints, craft-post-types, and posts-to-postsAPI is NOT turned on by default, so the vue-theme won’t have anything to display. You will need to start the API with the instructions below./%postname%/ in the text fieldAfter the API is active double check your settings in the .env file like so..
DB_PASSWORD=<change_me>
WORDPRESS_DB_USER=<default_user>
WORDPRESS_DB_PASSWORD=<change_me>
DB_NAME=<current_db>
IS_DEV=true
Make sure IS_DEV is set to true. This is important.
Currently the API uses localhost. This should be changed in production.
Set your directory owner to www-data with docker exec -it craft-wp chown -R www-data:www-data ./wp-content so your Wordpress container can write files
Lastly, run npm run dev to start the development server.
http://localhost:8081Setup a staging server and initialize a bare git repo in the /opt directory
git init --bare /opt/staging/vue-wp.git
Copy over the post-receive script from ./deployment to /opt/staging/vue-wp.git/hooks and make it executable with the command chmod ug+x /opt/staging/vue-wp.git/hooks/post-receive
On your development machine, add the staging server as a remote…
git remote add staging <user>@<server_ip>:/opt/staging/vue-wp.git
git push && git push staging and things will get pulled and built on the staging server. Sweet!Included is a drone config, and some recommended steps to build.
id_rsa of the drone host to appropriate key in the pipeline secrets under the name push_deploy_keyYou also need to setup a post-receive hook on the host server.
git remote add </opt/staging/vue-wp.git> staging mastergit init --bare </opt/staging/vue-wp.git>post-receive hook file into the </opt/staging/vue-wp.git/hooks/> directoryrsync -av <user>@<host>:/opt/vue-wp/uploads/ <local directory>rsync -azP <file-path-to>/uploads/* <user>@<host>:/opt/staging/vue-wp.git/uploads/
docker-compose exec -T craft-db mysqldump -u root -p current_cia | gzip > /home/<user_name>/backups/"`date +"%Y-%m-%d"`"-craftdb-backup.sql.gz
rsync -av <user>@<host>:/home/<user>/<date>-craftdb-backup.sql.gz <local directory>update wp_posts
set guid = replace(guid, 'http://old', 'http://143.110.234.41:8080/');