Skip to content

Commit

Permalink
1:1 mapping of npm cli commands to docker compose command
Browse files Browse the repository at this point in the history
  • Loading branch information
mountainash committed May 3, 2022
1 parent 26e0272 commit d6ccf18
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -10,6 +10,16 @@ Automate your WordPress development workflow.

For full documentation, visit https://www.wordpressify.co.

### v0.4.0 Changes

v0.4.0 moves NodeJS and all its dependencies into a container to keep your local development environment cleaner and to simplify Wordpressify even more.

1. `npm run dev` replaced with `docker compose up`
1. `npm run env:rebuild` replaced with `docker compose down -v`, then `docker compose build`
1. `npm run prod` replaced with `docker compose run --rm nodejs npm run prod`
1. `npm run backup` replaced with `docker compose run --rm nodejs npm run backup`
1. `npm run lint:css` replaced with `docker compose run --rm nodejs npm run lint:css`

## Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Expand Up @@ -49,8 +49,9 @@ services:
- .env
volumes:
- './src:/usr/src/app/src'
- './build:/usr/src/app/build'
- './dist:/usr/src/app/dist'
- './build:/usr/src/app/build'
- './backups:/usr/src/app/backups'
depends_on:
- 'webserver'
command: npm run dev
Expand Down
15 changes: 1 addition & 14 deletions gulpfile.js
Expand Up @@ -84,13 +84,6 @@ function registerCleanup(done) {
done();
}

async function envRebuild(done) {
await del(['build', 'xdebug', 'config/php.ini', '.env']);
done();
}
envRebuild.displayName = 'env:rebuild';
export { envRebuild };

/* -------------------------------------------------------------------------------------------------
Development Tasks
-------------------------------------------------------------------------------------------------- */
Expand Down Expand Up @@ -123,10 +116,6 @@ function Reload(done) {
done();
}

function copyWelcomeIndex() {
return src('./installer/welcome.html').pipe(dest('./build/wordpress'));
}

function copyThemeDev() {
if (!fs.existsSync('./build')) {
log(buildNotFound);
Expand Down Expand Up @@ -191,7 +180,6 @@ function pluginsDev() {

const dev = series(
registerCleanup,
copyWelcomeIndex,
copyThemeDev,
copyImagesDev,
copyFontsDev,
Expand All @@ -209,7 +197,7 @@ export { dev };
Production Tasks
-------------------------------------------------------------------------------------------------- */
async function cleanProd() {
await del(['./dist']);
await del(['./dist/*/']);
}

function copyThemeProd() {
Expand Down Expand Up @@ -296,7 +284,6 @@ Utility Tasks
const onError = (err) => {
beeper();
log(wpFy + ' - ' + errorMsg + ' ' + err.toString());
this.emit('end');
};

function Backup() {
Expand Down

0 comments on commit d6ccf18

Please sign in to comment.