I have a Wordpress / MySQL docker container that I use to develop themes and plugins. I am accessing this on localhost: 8000.
It uses the Gulp build process, and I'm trying to add a browser to the list. I find it difficult to get the browser actually proxy from the container. From the output of Gulp, I see that it generates changes, simply without making any changes to the browser.
Heres my docker-compose.yml, gulpfile, dockerfile and shell script.
version: '2' services: wordpress_db: image: mariadb restart: 'always' ports: - 3360:3306 volumes: - ./db_data:/docker-entrypoint-initdb.d environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress wordpress: depends_on: - wordpress_db image: wordpress restart: 'always' environment: WORDPRESS_DB_NAME: wordpress WORDPRESS_DB_USER: root WORDPRESS_DB_PASSWORD: wordpress ports: - 8000:3000 volumes: - ./uploads:/var/www/html/wp-content/uploads - ./plugins:/var/www/html/wp-content/plugins - ./theme:/var/www/html/wp-content/themes/theme links: - wordpress_db:mysql composer: image: composer/composer:php7 depends_on: - wordpress restart: 'no' environment: ACF_PRO_KEY: this_would_be_my_ACF_pro_key_:) volumes_from: - wordpress working_dir: /var/www/html/wp-content/themes/theme command: install node: restart: 'no' image: node:slim depends_on: - wordpress volumes_from: - wordpress working_dir: /var/www/html/wp-content/themes/theme build: context: . dockerfile: WordpressBuild args: - SITE_VERSION=0.0.1
var browserSync = require('browser-sync'); var reload = browserSync.reload; var watchify = require('watchify'); var browserify = require('browserify'); var source = require('vinyl-source-stream'); var buffer = require('vinyl-buffer'); var gulp = require('gulp'); var gutil = require('gulp-util'); var gulpSequence = require('gulp-sequence'); var processhtml = require('gulp-minify-html'); var sass = require('gulp-sass'); var autoprefixer = require('gulp-autoprefixer'); var watch = require('gulp-watch'); var cleanCSS = require('gulp-clean-css'); var uglify = require('gulp-uglify'); var streamify = require('gulp-streamify'); var sourcemaps = require('gulp-sourcemaps'); var concat = require('gulp-concat'); var babel = require('gulp-babel'); var fontawesome = require('node-font-awesome'); var prod = gutil.env.prod; var onError = function(err) { console.log(err.message); this.emit('end'); };
docker-compose.yml refers to the following docker file:
FROM node # Grab our version variable from the yml file ARG SITE_VERSION # Install gulp globally RUN npm install -g gulp node-gyp node-sass # Install dependencies COPY ./gulp-build.sh / RUN chmod 777 /gulp-build.sh ENTRYPOINT ["/gulp-build.sh"] CMD ["run"]
which installs Gulp and node-sass, and also copies the following gulp -guild.sh script into the container:
source share