{"id":15375338,"url":"https://github.com/twose/swoole-docker","last_synced_at":"2025-04-15T05:57:51.376Z","repository":{"id":133601084,"uuid":"115425533","full_name":"twose/swoole-docker","owner":"twose","description":"See: https://github.com/swoole/docker-swoole","archived":false,"fork":false,"pushed_at":"2019-01-18T06:59:10.000Z","size":55,"stargazers_count":126,"open_issues_count":1,"forks_count":31,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-15T05:57:45.542Z","etag":null,"topics":["coroutine","docker","swoole"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/twosee/swoole-coroutine/","language":"Dockerfile","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/twose.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2017-12-26T13:41:38.000Z","updated_at":"2025-03-30T18:54:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"17e97fff-edc0-4ff9-80a9-0ee158bdc428","html_url":"https://github.com/twose/swoole-docker","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.018181818181818188","last_synced_commit":"1f95a9b9c4affb8d406c5992016efab09bc10c0e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twose%2Fswoole-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twose%2Fswoole-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twose%2Fswoole-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twose%2Fswoole-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twose","download_url":"https://codeload.github.com/twose/swoole-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016325,"owners_count":21198832,"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":["coroutine","docker","swoole"],"created_at":"2024-10-01T14:02:41.477Z","updated_at":"2025-04-15T05:57:51.358Z","avatar_url":"https://github.com/twose.png","language":"Dockerfile","readme":"## Swoole-coroutine\n\n[**docker-hub**](https://hub.docker.com/r/twosee/swoole-coroutine/) \n\n[**github**](https://github.com/twose/swoole-coroutine-docker)\n\n### Usage\n\n```Bash\ndocker pull twosee/swoole-coroutine\ndocker pull twosee/swoole-coroutine:mysql\ndocker pull twosee/swoole-coroutine:redis\n```\n```Bash\ndocker run -d --name=swoole \\\n -v /workdir:/workdir \\\n -p 9501:9501 \\\n twosee/swoole-coroutine \\\n php /app/server.php start\n```\nOR\n```Bash\ndocker-compose up\n```\n### Introduction\n\n- 基于最新PHP7.2-cli版本\n- 使用swoole1.X~4.X最新版本构建, 所有功能火力全开\n- 提供Swoole的绝佳搭档:` MySQL`, `Redis`, `Inotify`, 配合`docker-compose`, 实现开箱即用\n- 已安装 [\"GD\", \"iconv\", \"pdo_mysql\", \"dom\", \"xml\", \"curl\", \"swoole\"]等PHP扩展\n- 已开启[\"coroutine\", \"openssl\", \"http2\", \"async-redis\", \"mysqlnd\", \"swoole-serialize\"]等所有功能\n- 纯环境 , 0冗余 , 绿色清洁 , 无任何php代码\n- 默认中国上海时区\n- inotify提供自动化热更新等支持\n\n---\n\n- Based on PHP7.2-cli\n- use swoole 1.*, 2.* and 4.*(libco) latest stable version, All functions are fully open\n- Provide the perfect partner for Swoole such as ` MySQL`, `Redis`, `Inotify` images, you can also use `docker-compose`, Out of the box.\n- PHP extension installed: [\"GD\", \"iconv\", \"pdo_mysql\", \"dom\", \"xml\", \"curl\", \"swoole\"]\n- enable [\"coroutine\", \"openssl\", \"http2\", \"async-redis\", \"mysqlnd\", \"swoole-serialize\"]\n- this container has no PHP code or framework included\n- Asia/Shanghai timezone default (you can remove it on the last RUN line)\n- Inotify provides hot auto updates and other support\n\n### Version\n\n| DIR      | INTRO                                                | Tag     |\n| -------- | ---------------------------------------------------- | ------- |\n| /master  | Latest master version (Experimental type)            | latest  |\n| /mysql   | It's a perfect MySQL8's docker                       | mysql   |\n| /mysql5  | It's a perfect MySQL5's docker                       | mysql5  |\n| /redis   | It's a perfect Redis's docker                        | redis   |\n| /inotify | inotify, composer, git, node, to support hot updates | inotify |\n| /release | Latest release version                               | release |\n| /1.x-lts | Latest version from branch 1.x-lts                   | 1.x-lts |\n| /2.x-lts | Latest version from branch 1.x-lts                   | 2.x-lts |\n\n### Docker-compose\n\nSwoole + mysql + redis\n\n```yaml\nversion: '3.4'\nservices:\n  swoole:\n    image: \"twosee/swoole-coroutine\"\n    ports:\n      - \"9501:9501\"\n    volumes:\n      - ./src:/app/src:rw\n    restart: always\n    depends_on:\n      - mysql\n    command: php /app/src/server.php start\n\n  mysql:\n    image: \"twosee/swoole-coroutine:mysql\"\n    ports:\n      - \"9502:3306\"\n    volumes:\n      - ./data/mysql/data:/var/lib/mysql:rw\n      - ./data/mysql/sock:/var/run/mysqld:rw # remove when windows.\n    restart: always\n    environment:\n      MYSQL_ROOT_PASSWORD: root_password_here\n      MYSQL_DATABASE: test\n      MYSQL_USER: php\n      MYSQL_PASSWORD: php_user_password_here\n    \n  redis:\n    image: \"twosee/swoole-coroutine:redis\"\n    ports:\n      - \"9503:6379\"\n    volumes:\n      - ./data/redis/data:/var/lib/redis:rw\n    sysctls:\n        net.core.somaxconn: 65535\n    restart: always\n\n  inotify:\n    image: \"twosee/swoole-coroutine:inotify\"\n    volumes:\n      - ./:/app:rw\n    restart: always\n    environment:\n      APP_ENV: dev # or product\n    working_dir: /app/util\n    command: /bin/bash inotify.sh\n```\nYou can see [mysqld.cnf](https://github.com/twose/swoole-coroutine-docker/tree/master/mysql).\n\n```php\n$options = [\n  'host'     =\u003e 'mysql', //So there.\n  'port'     =\u003e 3306,\n  'user'     =\u003e 'php',\n  'password' =\u003e 'php_user_password_here',\n  'database' =\u003e 'test'\n];\n$db = new \\Swoole\\Coroutine\\Mysql();\n$db-\u003econnect($options);\n```\nYou can see [redis.conf](https://github.com/twose/swoole-coroutine-docker/tree/master/redis).\n```php\n$redis = new \\Swoole\\Coroutine\\Redis();\n$redis-\u003econnect('redis', 6379);\n$val = $redis-\u003eget('foo');\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwose%2Fswoole-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwose%2Fswoole-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwose%2Fswoole-docker/lists"}