{"id":20148620,"url":"https://github.com/ideasonpurpose/docker-build","last_synced_at":"2026-04-13T13:32:07.642Z","repository":{"id":39672091,"uuid":"179202374","full_name":"ideasonpurpose/docker-build","owner":"ideasonpurpose","description":"Our Docker-based, webpack build-chain. Includes Sass, Imagemin, PostCSS, versioning and zipped snapshots.","archived":false,"fork":false,"pushed_at":"2025-03-17T15:54:11.000Z","size":8713,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-12T13:02:00.721Z","etag":null,"topics":["docker","webpack","wordpress"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ideasonpurpose.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-04-03T03:20:51.000Z","updated_at":"2025-03-17T15:54:16.000Z","dependencies_parsed_at":"2024-01-17T01:30:42.203Z","dependency_job_id":"51d9b221-e2c7-4fad-b688-b1e06f9e1df5","html_url":"https://github.com/ideasonpurpose/docker-build","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"purl":"pkg:github/ideasonpurpose/docker-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideasonpurpose%2Fdocker-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideasonpurpose%2Fdocker-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideasonpurpose%2Fdocker-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideasonpurpose%2Fdocker-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ideasonpurpose","download_url":"https://codeload.github.com/ideasonpurpose/docker-build/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ideasonpurpose%2Fdocker-build/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31754867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","webpack","wordpress"],"created_at":"2024-11-13T22:38:18.974Z","updated_at":"2026-04-13T13:32:07.618Z","avatar_url":"https://github.com/ideasonpurpose.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Build Tools\n\n#### Version 0.17.7\n\n\u003c!--[![dockeri.co](https://dockeri.co/image/ideasonpurpose/docker-build)](https://hub.docker.com/r/ideasonpurpose/docker-build)\u003cbr\u003e --\u003e\n\n[![Docker Pulls](https://img.shields.io/docker/pulls/ideasonpurpose/docker-build?logo=docker\u0026logoColor=white)](https://hub.docker.com/r/ideasonpurpose/docker-build) [![Push to DockerHub](https://github.com/ideasonpurpose/docker-build/actions/workflows/push-to-dockerhub.yml/badge.svg)](https://github.com/ideasonpurpose/docker-build/actions/workflows/push-to-dockerhub.yml) [![Coverage Status](https://coveralls.io/repos/github/ideasonpurpose/docker-build/badge.svg?branch=master)](https://coveralls.io/github/ideasonpurpose/docker-build?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/a6fabc9730a3b90b255c/maintainability)](https://codeclimate.com/github/ideasonpurpose/docker-build/maintainability)\n\nThis repository is the source for our local Docker-based WordPress development environment, it can be used for themes and plugins. Get the image on DockerHub: [hub.docker.com/r/ideasonpurpose/docker-build](https://hub.docker.com/r/ideasonpurpose/docker-build)\n\n## Configuration\n\nEach project should define a basic configuration object in a file named _ideasonpurpose.config.js_. The default configuration object looks like this:\n\n```js\nmodule.exports = {\n  src: \"./src\",\n  dist: \"./dist\",\n  entry: [\"./js/index.js\"],\n  publicPath: \"/assets/dist/\",\n};\n```\n\n### Config object\n\n#### `src`\n\nThe filesystem path to the directory where assets source files can be found.\n\n#### `dist`\n\nThe filesystem path to the output directory where Webpack will generate files.\n\n#### `entry`\n\nThis can be an array of paths, a string path or a pre-configured Webpack entry object. For arrays, named entry points will be extrapolated from each entry's basename. Strings will be treated as single-element arrays. Objects will passthrough unchanged.\n\n#### `publicPath`\n\nThis is the public url path to the dist folder. Web browsers will reference our generated assets from this location. These paths are visible in the generated manifest. Paths are joined naively, you'll probably want to include a trailing slash.\n\n#### `sass` (optional)\n\nSpecify the Sass implementation for [Sass-loader][]. Supports `sass-embedded` ([embedded-host-node][], native) and `sass` ([js-compiled Dart-sass][]). Default: **`sass-embedded`**,  [`node-sass`][] is no longer supported\n\n#### `proxy` (optional)\n\nWhen set, Webpack's devserver will proxy this server, replacing requested assets as appropriate.\n\n#### `transpileDependencies` (optional)\n\nA list NPM modules which should be transpiled by babel. Many useful packages on NPM ship es6 code which crashes on older browsers. List those modules here so they can be included in the transpilation pipeline.\n\n#### `devtool` (optional)\n\nThis value is passed directly into the webpack config. Use it to experiment with different [source-map generation settings](https://webpack.js.org/configuration/devtool/).\n\n### WordPress config\n\nFor WordPress sites, the config file will look something like this:\n\n```js\nconst pkg = require(\"./package.json\");\n\nmodule.exports = {\n  src: `./wp-content/themes/${pkg.name}/src`,\n  dist: `./wp-content/themes/${pkg.name}/dist`,\n  entry: [\"./js/main.js\", \"./js/admin.js\", \"./js/editor.js\"],\n  publicPath: `/wp-content/themes/${pkg.name}/dist/`,\n};\n```\n\n\u003c!--\n### Jekyll config\n\nFor Jekyll projects, the config will look something like this:\n\n```js\nmodule.exports = {\n  src: `./_assets/`,\n  dist: `./dist/`,\n  entry: [\"./js/main.js\"],\n  publicPath: `/dist/`,\n  contentBase: \"/_site/\", // Location webpack devServer will serve static files from\n  manifestFile: \"../_data/dependency-manifest.json\", // Write the dependency-manifest into _data\n};\n```\n--\u003e\n\n## Running a build from Docker\n\n### Example runs\n\n#### Mac/Linux\n\n```sh\n$ docker run -p 8080:8080 --env NAME=iop-sscgf --env HOSTNAME=joes-mbp.local -v $PWD:/usr/src/site ideasonpurpose/docker-build npm run build\n```\n\nThis can also be run with `npm run build`\n\n#### Windows Command Line\n\n```cmd\n$ docker run -p 8080:8080 --env NAME=iop-sscgf --env HOSTNAME=joes-mbp.local -v %cd%:/usr/src/site ideasonpurpose/docker-build npm run build\n```\n\n\u003e Notes: The only difference between the POSIX and Windows commands is the using the Windows' varible `%cd%` instead of `$PWD`.\n\u003e\n\u003e If Windows throws a \"driver failed programming external connectivity on endpoint\" error, restart Docker. See [docker/for-win#2722](https://github.com/docker/for-win/issues/2722)\n\n### Commands\n\n#### `build`\n\nRuns a webpack production build. This will also generate a zipped snapshot. _(todo: does this work?)_\n\n#### `start`\n\nBuilds assets, starts the Webpack DevServer and watches files for changes.\n\n### Environment vars\n\n#### `NAME`\n\nThe name of the project, ideally the `name` property from package.json. This should match the directory containing the project files.\n\n### Volumes\n\nMount the project's web root directory to `/usr/src/site`\n\n## Notes\n\n\u003e Documentation notes to be cleaned up\n\nTooling runs from `/usr/src/tools` inside the Docker image. Site files are expected to be mounted to `/usr/src/site`\n\nRequesting [`/webpack/reload`](http://localhost:8080/webpack/reload) from the devserver will will trigger a full reload for all connected clients.\n\n### Code Splitting and deferred loading\n\nCode splitting is automatic, required libraries will be de-duped and loaded from a shared module. These are specified in the dependency-manifest file.\n\nDeferred dynamic imports also work. To use these, follow the example in the [Webpack API docs](https://webpack.js.org/api/module-methods/#import-1):\n\n```js\nif (some.condition) {\n  import(\"./other-file.js\").then((module) =\u003e {\n    // access any exports from module here\n  });\n}\n```\n\n### Image Handling\n\nImages found in `/src` will be processed as follows:\n\n- **.jpg** - Optimized with Sharp, [Mozjpeg defaults](https://sharp.pixelplumbing.com/api-output#jpeg), 77% quality\n- **.png** - [Sharp defaults](https://sharp.pixelplumbing.com/api-output#png)\n- **.svg** - Copied without processing\n\nImages required into JS source files will be processed by webpack as [general assets](https://webpack.js.org/guides/asset-modules/#general-asset-type) with the following additions:\n\n- **.jpg**\n- **.svg** - Available as SVGR\n\nIn practice, automated SVG processing was found to be more of a hindrance than helpful. More often it was easier to manually pre-process the files using SVGO, selectively preserving structure and attributes on a per-file basis.\n\n### Local Development\n\nTo iterate locally, build the image using the same name as the Docker Hub remote. Docker will use the local copy. Specify `dev` if you're using using versions.\n\n```sh\ndocker build . --tag ideasonpurpose/docker-build:dev\n```\n\nTooling can be used outside of Docker by creating a sibling `site` directory alongside the checkout of this project. For existing projects, set the `NAME` envvar to the theme name before the command like this: `NAME=example-theme npm run webpack`.\n\nAlso note that `NODE_ENV` will default to `development` so be sure to set it to `production` when testing builds: `NAME=example-theme NODE_ENV=production npm run webpack`\n\n### Debugging webpack\n\nIt's possible to debug webpack inside the container by calling `npm run start:debug` instead of the regular `start` command. The build tools will start and report to be listening on port 9229, like this:\n\n```\nDebugger listening on ws://0.0.0.0:9229/ddd8e8e2-0cc9-4163-9a13-dc21579af829\nFor help, see: https://nodejs.org/en/docs/inspector\n```\n\nOpen the Node debugger in Chrome or Edge developer console and there should be a little green hexagon Node.js icon in the upper right next to the Select Element and Device Emulation icons. Click that to attach to the debugger, find the files in the sidebar and add some breakpoints.\n\nThings that aren't working yet: Code changes, VS Code's debugger. But this does allow breakpoints and deep inspection of the running webpack instance.\n\nThe **zip.mjs** script can be debugged in VS Code using the **Debug zip.mjs** launch config. It should appear in the VS Code Run and Debug menu.\n\n## Related Projects\n\nThis toolset is installed with our [Docker-based WordPress development environments][docker-wordpress-dev].\n\n## \u0026nbsp;\n\n#### Brought to you by IOP\n\n\u003ca href=\"https://www.ideasonpurpose.com\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ideasonpurpose/ideasonpurpose/master/iop-logo-white-on-black-88px.png\" height=\"44\" align=\"top\" alt=\"IOP Logo\"\u003e\u003c/a\u003e\u003cimg src=\"https://raw.githubusercontent.com/ideasonpurpose/ideasonpurpose/master/spacer.png\" align=\"middle\" width=\"4\" height=\"54\"\u003e This project is actively developed and used in production at \u003ca href=\"https://www.ideasonpurpose.com\"\u003eIdeas On Purpose\u003c/a\u003e.\n\n\n[sass-loader]: https://webpack.js.org/loaders/sass-loader/\n[node-sass]: https://github.com/sass/node-sass\n[dart-sass]: https://github.com/sass/dart-sass\n[embedded-host-node]: https://github.com/sass/embedded-host-node\n[cosmiconfig]: https://www.npmjs.com/package/cosmiconfig\n[docker-wordpress-dev]: https://github.com/ideasonpurpose/docker-wordpress-dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideasonpurpose%2Fdocker-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fideasonpurpose%2Fdocker-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fideasonpurpose%2Fdocker-build/lists"}