{"id":18553050,"url":"https://github.com/ustwo/docker-browser-sync","last_synced_at":"2025-04-09T22:32:10.740Z","repository":{"id":31904779,"uuid":"35473825","full_name":"ustwo/docker-browser-sync","owner":"ustwo","description":"Docker image for BrowserSync","archived":false,"fork":false,"pushed_at":"2017-02-15T17:24:21.000Z","size":23,"stargazers_count":39,"open_issues_count":3,"forks_count":4,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-03-24T13:21:21.481Z","etag":null,"topics":["browsersync","docker","javascript"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/ustwo/browser-sync/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ustwo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-12T07:35:20.000Z","updated_at":"2023-11-04T13:19:13.000Z","dependencies_parsed_at":"2022-08-25T05:22:45.105Z","dependency_job_id":null,"html_url":"https://github.com/ustwo/docker-browser-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustwo%2Fdocker-browser-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustwo%2Fdocker-browser-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustwo%2Fdocker-browser-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ustwo%2Fdocker-browser-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ustwo","download_url":"https://codeload.github.com/ustwo/docker-browser-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123816,"owners_count":21051537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["browsersync","docker","javascript"],"created_at":"2024-11-06T21:15:56.612Z","updated_at":"2025-04-09T22:32:09.981Z","avatar_url":"https://github.com/ustwo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker image for browser-sync\n\nThis Docker image wraps [BrowserSync](http://www.browsersync.io/) exposing its\ncommand-line interface as the `ENTRYPOINT`.  This means you can use this image\nas drop-in replacement for Browser Sync's CLI.\n\n**Note**: please note this document assumes you're using Docker 1.9 or above.\n\nIt has been tested with Docker for Mac and with Docker Machine on OSX.\n\n\n## Table of Contents\n\n* [How to use this image](#how-to-use-this-image).\n* [Docker Machine in OSX](#docker-machine-in-osx).\n\n\n## How to use this image\n\nThe basic Browser Sync examples translated are the exact same commands with\nthe docker command prefixing it.\n\n### Static sites\n\nThe following case publishes port 3000 and port 3001 so you can use the\nstatic server and configure Browser Sync as always.\n\n```sh\ndocker run -dt \\\n           --name browser-sync \\\n           -p 3000:3000 \\\n           -p 3001:3001 \\\n           -v $(PWD):/source \\\n           -w /source \\\n           ustwo/browser-sync \\\n           start --server --files \"css/*.css\"\n```\n\n### Dynamic sites\n\nIn this case, you have to let Docker know how to resolve the host you are\nproxying to.  There are a couple of ways to do this so we'll go one by one.\n\n#### Link\n\nA docker link is a one-way connection between two containers.  Order matters\nso you have to **first** start your app and then link Browser Sync to it:\n\n```sh\ndocker run -dt --name myapp -p 8000:8000 myimage\n\ndocker run -dt \\\n           --name browser-sync \\\n           --link myapp \\\n           -p 3000:3000 \\\n           -p 3001:3001 \\\n           ustwo/browser-sync \\\n           start --proxy \"myapp:8000\" --files \"css/*.css\"\n```\n\nNotice the name of the app and the link are the same, and the browser sync\nproxy flag has the same name as well as the exposed port of your app.  There\nis no need to use the `-p 8000:8000` flag, it is just to make it more clear.\n\n\n#### Custom network\n\nA docker network is a connection between multiple containers.  Unlike links,\norder does not matter so it is a more robust solution, but it requires setting\nup the network before running the containers.  It is a one-time thing though:\n\n```sh\ndocker network create bs\n```\n\nThen you start both services as follows:\n\n```sh\ndocker run -dt --name myapp --net bs myimage\n\ndocker run -dt \\\n           --name browser-sync \\\n           --net bs \\\n           -p 3000:3000 \\\n           -p 3001:3001 \\\n           ustwo/browser-sync \\\n           start --proxy \"myapp:8000\" --files \"css/*.css\"\n```\n\n\n### Config file\n\nGiven the image exposes Browser Sync's CLI as is, you can use a config file\nas well.\n\n```sh\ndocker run -dt \\\n           --name browser-sync \\\n           --net bs \\\n           -p 3000:3000 \\\n           -p 3001:3001 \\\n           ustwo/browser-sync \\\n           -v $(PWD)/config.js:/source/config.js \\\n           start --config config.js\n```\n\n\n## Docker Compose\n\nTake a look to [docker-compose.yml](./docker-compose.yml) for a simple case.\n\n\n## Docker Machine in OSX\n\nDocker Machine with Virtualbox has limited support of filesystem events.\n[BrowserSync](http://www.browsersync.io/) uses filesystem events as its main\nstrategy to watch for changes and falls back to polling otherwise.  If you are\nin this situation you can only use the polling strategy as shown in `sandbox/polling.js`.\n\n\n## Contact\n\n* open.source@ustwo.com\n\n\n## Maintainers\n\n* Arnau Siches (@arnau)\n\n## License\n\nThere is no guarantee of active maintenance. Licensed under MIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fustwo%2Fdocker-browser-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fustwo%2Fdocker-browser-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fustwo%2Fdocker-browser-sync/lists"}