This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
$ docker-compose up -d
# To Tear Down
$ docker-compose down --volumes
| function fieldSorterOptimized(fields) { | |
| var dir = [], i, l = fields.length; | |
| fields = fields.map(function(o, i) { | |
| if (o[0] === "-") { | |
| dir[i] = -1; | |
| o = o.substring(1); | |
| } else { | |
| dir[i] = 1; | |
| } | |
| return o; |
This is a simple way of importing MySQL database in Docker.
In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.
Put the exported sql file in the shared folder.
Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.
Login to MySQL via mysql -u USERNAME -p.
| -- variables: PREFIX; URL; HTDOCS_DIR | |
| -- TODO/TRY UPDATE PREFIXposts SET guid = replace(guid, 'URL', 'http://localhost:8888/HTDOCS_DIR'); | |
| UPDATE PREFIXoptions SET option_value = replace(option_value, 'URL', 'http://localhost:8888/HTDOCS_DIR') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE PREFIXposts SET post_content = replace(post_content, 'URL', 'http://localhost:8888/HTDOCS_DIR'); | |
| UPDATE PREFIXpostmeta SET meta_value = replace(meta_value, 'URL','http://localhost:8888/HTDOCS_DIR'); |
| /* | |
| Generates a populated Job Card PDF using the data in the supplied array and returns an application file path to the newly generated PDF. | |
| Requires the inclusion of the util function: 'generateJobCardFDF($inputData)' | |
| */ | |
| function generatePopulatedJobCardPDF($jobCardData){ | |
| //Format the form data | |
| $formData['Job_Number']=$jobCardData['']; | |
| $formData['Customer']=$jobCardData['']; | |
| $formData['Description']=$jobCardData['']; |
| // config/passport.js | |
| // load all the things we need | |
| var LocalStrategy = require('passport-local').Strategy; | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |
| # ----------------------------------------------------------------- | |
| # .gitignore for WordPress | |
| # Bare Minimum Git | |
| # http://ironco.de/bare-minimum-git/ | |
| # ver 20150227 | |
| # | |
| # This file is tailored for a WordPress project | |
| # using the default directory structure | |
| # | |
| # This file specifies intentionally untracked files to ignore |
| <?php | |
| //Display Fields | |
| add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 ); | |
| //JS to add fields for new variations | |
| add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' ); | |
| //Save variation fields | |
| add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 ); | |
| /** |
| <VirtualHost *:{PORT}> | |
| ServerName www.yourdomain.com | |
| ServerAdmin [email protected] | |
| DocumentRoot /var/www/yourdir/ | |
| <Directory /var/www/yourdir> | |
| Options Indexes FollowSymLinks | |
| AllowOverride all | |
| Order allow,deny |