{"id":28764970,"url":"https://github.com/klen/muffin-docker","last_synced_at":"2025-10-23T22:02:37.723Z","repository":{"id":39634947,"uuid":"377451145","full_name":"klen/muffin-docker","owner":"klen","description":"Docker images for Muffin Framework","archived":false,"fork":false,"pushed_at":"2024-10-17T15:06:07.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T22:01:06.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/klen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2021-06-16T10:02:59.000Z","updated_at":"2024-10-17T15:06:11.000Z","dependencies_parsed_at":"2023-10-04T22:26:43.557Z","dependency_job_id":"412fff76-8745-467a-accf-7b3cfba8d7c3","html_url":"https://github.com/klen/muffin-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/klen/muffin-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/muffin-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fmuffin-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260336372,"owners_count":22993742,"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":[],"created_at":"2025-06-17T10:13:11.246Z","updated_at":"2025-10-23T22:02:37.718Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![tests](https://github.com/klen/muffin-docker/actions/workflows/tests.yml/badge.svg)](https://github.com/klen/muffin-docker/actions/workflows/tests.yml)\n[![build](https://github.com/klen/muffin-docker/actions/workflows/build.yml/badge.svg)](https://github.com/klen/muffin-docker/actions/workflows/build.yml)\n[![dockerhub](https://img.shields.io/docker/v/horneds/muffin/latest)](https://hub.docker.com/r/horneds/muffin)\n\n\n# muffin-docker\n\n- Python(muffin, uvicorn, gunicorn): https://hub.docker.com/r/horneds/muffin\n- Same + NodeJS: https://hub.docker.com/r/horneds/muffin-node\n\n[**Docker**](https://www.docker.com/) image with [**Muffin**](https://klen.github.io/muffin/) managed by [**Gunicorn**](https://gunicorn.org/)\n\n## Supported images\n\n* [muffin:py39](https://github.com/klen/muffin-docker/blob/master/images/muffin.dockerfile), [muffin-node:py39](https://github.com/klen/muffin-docker/blob/master/images/muffin-node.dockerfile)\n* [muffin:py310](https://github.com/klen/muffin-docker/blob/master/images/muffin.dockerfile), [muffin-node:py310](https://github.com/klen/muffin-docker/blob/master/images/muffin-node.dockerfile)\n* [muffin:py311](https://github.com/klen/muffin-docker/blob/master/images/muffin.dockerfile), [muffin-node:py311](https://github.com/klen/muffin-docker/blob/master/images/muffin-node.dockerfile)\n* [muffin:py312, muffin:latest](https://github.com/klen/muffin-docker/blob/master/images/muffin.dockerfile), [muffin-node:py312, muffin-node:latest](https://github.com/klen/muffin-docker/blob/master/images/muffin-node.dockerfile)\n\n## How to use\n\n* You don't need to clone the GitHub repo. You can use this image as a base image for other images, using this in your `Dockerfile`:\n\n```Dockerfile\nFROM horneds/muffin:latest\n\nCOPY ./app /app\n```\n\nIt will expect a file at `/app/app.py`.\n\nOr otherwise a file at `/app/main.py`.\n\nAnd will expect it to contain a variable `app` with your \"ASGI\" application.\n\nThen you can build your image from the directory that has your `Dockerfile`, e.g:\n\n```bash\ndocker build -t myimage ./\n```\n\n* Run a container based on your image:\n\n```bash\ndocker run -d --name mycontainer -p 80:80 myimage\n```\n\nYou should be able to check it in your Docker container's URL, for example: http://127.0.0.1/ (or equivalent, using your Docker host).\n\n## Dependencies and packages\n\nYou will probably also want to add any dependencies for your app and pin them\nto a specific version, probably including Uvicorn and Gunicorn.\n\nThis way you can make sure your app always works as expected.\n\nYou could install packages with `pip` commands in your `Dockerfile`, using a\n`requirements.txt`, or even using [Poetry](https://python-poetry.org/).\n\n### Using PIP\n\nHere's a small example of one of the ways you could install your dependencies\nmaking sure you have a pinned version for each package.\n\nLet's say you have a your dependencies in a file `requirements.txt`.\n\nThen you could have a `Dockerfile` like:\n\n```Dockerfile\nFROM horneds/muffin:latest\n\n# Copy and install dependencies\nCOPY ./requirements.txt /app/requirements.txt\nRUN pip install -r /app/requirements.txt\n\nCOPY ./app /app\n```\n\nThat will:\n\n* Copy your application requirements.\n* Install the dependencies.\n* Then copy your app code.\n\n## Advanced usage\n\n### Environment variables\n\n* **MODULE_NAME** (`app`, `main`, `app.app`, `app.main`) -- python module that\n  contains Muffin application\n\n* **VARIABLE_NAME** (`app`) -- The variable inside of the Python module that\n  contains the Muffin application\n\n* **SETUP_SCRIPT** -- Optional setup script to run before start gunicorn\n\n* **GWORKER_CLASS** (`uvicorn.workers.UvicornWorker`) -- Gunicorn Worker Class\n\n* **GWORKERS** (`num of CPU`) -- Number of gunicorn workers\n\n* **HOST** (`0.0.0.0`) -- Host to bind the server\n\n* **PORT** (`80`) -- Port to bind the server\n\n* **GBIND** (`0.0.0.0:80`) -- Address (host:port) to bind the server inside the\n  container. If the variable is set, the variables `$HOST`, `$PORT` will be\n  ignored.\n\n* **GLOG_LEVEL** (`info`) -- Gunicorn log level\n\n* **GUNICORN_CMD_ARGS** -- Optional Gunicorn command arguments\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fmuffin-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fmuffin-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fmuffin-docker/lists"}