├── .gitignore ├── composer.lock ├── Procfile ├── last_install.txt ├── start.sh ├── composer.json ├── tools └── create_wp_config.sh ├── README.md ├── LICENSE └── Makefile /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: /app/start.sh 2 | -------------------------------------------------------------------------------- /last_install.txt: -------------------------------------------------------------------------------- 1 | Fri Dec 12 13:05:52 CET 2014 2 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "Copying files...." 3 | cp -ur /app/web/wp-content.orig/* /app/web/wp-content 4 | chmod -R 777 /app/web/wp-content 5 | echo "Finished." 6 | vendor/bin/heroku-php-nginx web/ -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "post-install-cmd": [ 4 | "mv web/wp-content web/wp-content.orig" 5 | ] 6 | }, 7 | "require-dev": { 8 | "heroku/heroku-buildpack-php": "*" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tools/create_wp_config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | grep -A 1 -B 50 'since 2.6.0' wp-config-sample.php > wp-config.php 4 | curl https://api.wordpress.org/secret-key/1.1/salt/ >> wp-config.php 5 | grep -A 50 -B 3 'Table prefix' wp-config-sample.php >> wp-config.php 6 | 7 | sed -i .bak "s/'database_name_here'/getenv('DB_NAME')/" wp-config.php 8 | sed -i .bak "s/'username_here'/getenv('DB_USER')/" wp-config.php 9 | sed -i .bak "s/'password_here'/getenv('DB_PASS')/" wp-config.php 10 | sed -i .bak "s/'localhost'/getenv('DB_HOST')/" wp-config.php -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **This plugin is out of date, we recommend this one: https://github.com/dokku-community/dokku-wordpress. Successfully tested on Dokku 7.2.** 2 | 3 | 4 | dokku-wordpress-template 5 | ======================== 6 | 7 | Wordpress can be quite a .... hassle to set up on Dokku. This template makes is considerably easier. 8 | 9 | 10 | Requirements: 11 | - dokku (latest) 12 | - https://github.com/wmluke/dokku-domains-plugin 13 | - https://github.com/ohardy/dokku-mariadb 14 | - https://github.com/ohardy/dokku-volume 15 | 16 | 17 | Extract the files into a new folder, edit the variables on to of the Makefile and call ```make install``` 18 | 19 | E.g.: 20 | ``` 21 | git clone https://github.com/dudagroup/dokku-wordpress-template.git myproject 22 | cd myproject 23 | rm -rf .git # except if your contributing to this :-) 24 | vi Makefile 25 | make install 26 | ``` 27 | 28 | If everything succeeded you'll have a new instance running! 29 | 30 | Please be aware, that this is just a Makefile..... and still under development. 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 DU DA GROUP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # MODIFIY THESE THREE SETTINGS 2 | # will also be the Name on the dokku host 3 | PROJECT_NAME=wptest 4 | 5 | # dokku.mycompany.com or whatever 6 | DOKKU_HOST=d 7 | 8 | # ussually it's dokku 9 | DOKKU_USER=dokku 10 | 11 | # in case you have want to push something else than master 12 | BRANCH=master 13 | 14 | # the name of the local git remote 15 | GIT_TARGET=live 16 | 17 | # requires the domains plugins and sets the domain 18 | VHOST=wptest.dokku.dudagroup.com 19 | 20 | # You dont have to modify anything below this line 21 | DOKKU_CMD=ssh $(DOKKU_USER)@$(DOKKU_HOST) 22 | 23 | download_wordpress: 24 | echo "Downloading Wordpress...." 25 | mkdir web 26 | curl -o latest.zip -LOk https://wordpress.org/latest.zip 27 | unzip -q latest.zip -d web 28 | mv web/wordpress/* web 29 | rm -rf web/wordpress 30 | rm latest.zip 31 | 32 | configure_wordpress: 33 | cd web;../tools/create_wp_config.sh 34 | 35 | configure_domains: 36 | $(DOKKU_CMD) domains:set $(PROJECT_NAME) $(VHOST) 37 | 38 | setup_git: 39 | echo "Setting up git remotes...." 40 | git init 41 | git remote add $(GIT_TARGET) $(DOKKU_USER)@$(DOKKU_HOST):$(PROJECT_NAME) 42 | git add . 43 | git commit -am "Setup of Project: $(PROJECT_NAME)" 44 | 45 | setup_dokku_volume: 46 | echo "Adding docker volume" 47 | $(DOKKU_CMD) volume:add $(PROJECT_NAME) /app/web/wp-content 48 | 49 | setup_mariadb: 50 | echo "Creating DB" 51 | $(DOKKU_CMD) mariadb:create $(PROJECT_NAME) 52 | 53 | install: download_wordpress configure_wordpress setup_git deploy setup_dokku_volume setup_mariadb configure_domains 54 | date > last_install.txt 55 | git add last_install.txt 56 | git commit -am "Installation finished, redeployment imminent" 57 | git push $(GIT_TARGET) $(BRANCH) 58 | echo "All done! Let's wait 5s....." 59 | sleep 5 # lets wait, so that the host is up 60 | open http://$(VHOST) 61 | 62 | deploy: 63 | git push $(GIT_TARGET) $(BRANCH) 64 | 65 | backup: 66 | $(DOKKU_CMD) mariadb:dump $(PROJECT_NAME) > backup_$(PROJECT_NAME)_mariadb.sql 67 | $(DOKKU_CMD) volume:dump $(PROJECT_NAME) /app/web/wp-content > backup_$(PROJECT_NAME)_wp_content.tar.gz 68 | 69 | clean: 70 | rm -rf web 71 | git remote remove $(GIT_TARGET) 72 | $(DOKKU_CMD) volume:remove $(PROJECT_NAME) /app/web/wp-content 73 | $(DOKKU_CMD) mariadb:delete $(PROJECT_NAME) 74 | $(DOKKU_CMD) undeploy $(PROJECT_NAME) 75 | 76 | --------------------------------------------------------------------------------