{"id":15065984,"url":"https://github.com/janithcooray/sync-stat","last_synced_at":"2025-10-05T03:30:39.799Z","repository":{"id":40501463,"uuid":"504876105","full_name":"janithcooray/sync-stat","owner":"janithcooray","description":"sync-stat npm package to speed up mounted volumes on docker","archived":true,"fork":false,"pushed_at":"2022-07-19T19:45:13.000Z","size":602,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-26T00:58:21.420Z","etag":null,"topics":["docker","docker-compose","docker-volume-plugin","docker-volumes"],"latest_commit_sha":null,"homepage":"https://sync-stat.nova64.xyz/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janithcooray.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2022-06-18T15:11:13.000Z","updated_at":"2023-03-07T04:55:06.000Z","dependencies_parsed_at":"2022-07-12T21:32:34.186Z","dependency_job_id":null,"html_url":"https://github.com/janithcooray/sync-stat","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janithcooray%2Fsync-stat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janithcooray%2Fsync-stat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janithcooray%2Fsync-stat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janithcooray%2Fsync-stat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janithcooray","download_url":"https://codeload.github.com/janithcooray/sync-stat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219876883,"owners_count":16554798,"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":["docker","docker-compose","docker-volume-plugin","docker-volumes"],"created_at":"2024-09-25T00:59:01.339Z","updated_at":"2025-10-05T03:30:34.192Z","avatar_url":"https://github.com/janithcooray.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Storage Sync for Faster Development on MacOS and Windows\n\n## !Still only works on MacOS, documentation is also incomplete. please wait till release 1.0 +\n\n## Pleast note that this is a pre-release, functionality is still partial! \u003cbr\u003e Wait for a newer update!!\n\n[![CodeQL](https://github.com/janithcooray/sync-stat/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/janithcooray/sync-stat/actions/workflows/codeql-analysis.yml)\n[![Node.js Package](https://github.com/janithcooray/sync-stat/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/janithcooray/sync-stat/actions/workflows/npm-publish.yml)\n\n---\n\n## What it does\n\nsync-stat is an NPX CLI toolkit that offers an alternative to Docker Bind Mounts that is on par with Bind mounts on Linux Based FSs in terms of performance for MacOS.(Windows NTFS support is comming soon)\n\nDocker with bind mounts can really cause a major performance penalty in MacOS (APPFS) and windows (NTFS)\n\nWindows has WSL so it's not really effected but it would be nice if it would work as fast as bind mounts in linux in NTFS\n\nsync-stat also offers some other options that docker cp / bind mounts do not offer. such as the ability to set an explicit user group and mode to the directory\n\n---\n\n## Installation\n\n### Install via NPM\n\n```sh\nnpm i sync-stat\n```\n\n## Configure - create `sync-compose.yaml`\n\ncreate a YAML file named `sync-compose.yaml` at the root directory of your project\n\n```yaml\nversion: 1\n\ncontainers: #Array\n  - name-of-container: #Array - must be defined in docker-compose or name container on start\n      volumes: # Bind Mounts - Array\n        - volume: # Item - config for each bind\n            profile: local # profile names will group volumes, can use run \u003cprofilename\u003e to activate only the volumes in the group. if empty it will be activated too.\n            from: app/ # From location relative to \u003cProjectRoot\u003e =\u003e app/  || does not support ./app yet\n            to: /var/www/html/ # to location inside docker container\n            mode: 775 # Mode to write files\n            owner: www-data:www-data # owner to write files as\n            cmd: #Run the Following commands on start, this only runs 1 time\n              - npm install\n              - composer install\n            ignore: #ignore these directories when syncing\n              - node_modules/\n            replace: # replace these strings when copying\n              - 'localhost:mysql-db'\n\ndatabase:\n  driver: mysql # Currently only mysql is supported\n  profile: staging # Profiles\n  method: export # [ export | dump ]\n  file: /path/to/dump.sql #[ ./relative | /absolute ]/path/to/dump.sql . will only be used when method is in export\n  server: # externel server config\n    database_user: user\n    database_name: dbname\n    database_pass: pass\n    host: server.name\n    port: 3306\n  local: # local server config. external servers can  be used too\n    provision: true # drop db if it exists, create if not exist. needs root password\n    database_user: user\n    database_name: dbname\n    database_pass: pass\n    root_password: root_password # only used for provision function\n    host: localhost\n    port: 3306\n```\n\n## Example\n\ndocker-compose.yml\n\n```yml\nversion: '3.9'\n\nservices:\n  wordpress:\n    container_name: mytest-container\n    image: some-image #REPLACE\n    volumes:\n      - ./app:/var/www/html # (IMPORTANT!) REMOVE THIS. sync-stat will Automaticall do this\n      # MOUNT CANNOT MATCH THE ONE IN SYNC-COMPOSE\n      # IF YOU DONT REMOVE THAT LINE, IT WILL CAUSE AN ERROR.\n    ports:\n      - '8000:80'\n    ## application is placed at /var/www/html\n```\n\nsync-compose.yaml\n\n```yaml\nversion: 1\n\ncontainers:\n  - mytest-container:\n      volumes:\n        - volume:\n            profile: local\n            from: app/\n            to: /var/www/html/\n            mode: 775\n            owner: www-data:www-data\n            cmd:\n              - echo hi\n            ignore:\n              - node_modules/\n            replace:\n              - 'string:string'\n```\n\n## RUN\n\n### Start your docker container or compose setup\n\nmake sure to name the container with matching names defined in the sync-compose.json\n\n### Start Sync\n\nOnce Containers are online run the following in the root directory\n\n```sh\nnpx syncstat run\n```\n\nrunning profiles\n\n```sh\nnpx syncstat run \u003cprofilename\u003e\n```\n\nwhen using run `\u003cprofilename\u003e`, only volumes that match the profile name will be added. volumes without profile names will be added as well.\n\n### Running DB\n\n```sh\nnpx syncstat db\n```\n\nor with profiles\n\n```sh\nnpx syncstat db \u003cprofile\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanithcooray%2Fsync-stat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanithcooray%2Fsync-stat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanithcooray%2Fsync-stat/lists"}