{"id":15443989,"url":"https://github.com/tardo/docker-flask","last_synced_at":"2026-04-09T01:31:51.262Z","repository":{"id":107988328,"uuid":"497453902","full_name":"Tardo/docker-flask","owner":"Tardo","description":"Docker image to run flask applications using gunicorn","archived":false,"fork":false,"pushed_at":"2022-06-04T03:32:56.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-04T01:44:48.568Z","etag":null,"topics":["docker-image","flask","gunicorn","npm","poetry","postcss","rollup","supervisord"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Tardo.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":"2022-05-29T00:10:43.000Z","updated_at":"2024-03-27T08:47:51.000Z","dependencies_parsed_at":"2024-07-20T13:45:51.120Z","dependency_job_id":null,"html_url":"https://github.com/Tardo/docker-flask","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Tardo/docker-flask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tardo%2Fdocker-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tardo%2Fdocker-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tardo%2Fdocker-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tardo%2Fdocker-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tardo","download_url":"https://codeload.github.com/Tardo/docker-flask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tardo%2Fdocker-flask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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-image","flask","gunicorn","npm","poetry","postcss","rollup","supervisord"],"created_at":"2024-10-01T19:38:32.581Z","updated_at":"2026-04-09T01:31:51.235Z","avatar_url":"https://github.com/Tardo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DOCKER FLASK\n---\n\nThis docker image is prepared to run Flask applications using gunicorn. In addition, this image provides poetry and npm with rollup and postcss.\n\n\n#### Important notes\n\n- This image is for Flask projects using poetry, gunicorn, supervisor and npm.\n- This image doesn't come with gunicorn and supervisor installed, this must be provided by your poetry configuration.\n\n\n#### Mount points of interest\n\n| MOUNT POINT | DESCRIPTION |\n|----------|---------|\n| /usr/src/app | Here is where your flask application must be | \n| /root/.cache | Here is where poetry stores the packages |\n| /root/.npm | Here is where npm stores the packages |\n\n\n#### About your flask configuration\n\nThreaded mode is handled by gunicorn so you must disable `threaded` mode in the configuration of your flask application.\n\n\n#### Customize poetry and npm project installation process\n\n| ENV. VAR | DEFAULT | Example |\n|----------|---------|---------|\n| $POETRY_INSTALL_ARGS | Empty | --no-dev  | \n| $NPM_INSTALL_ARGS | Empty | --no-save --omit=dev |\n\n\n#### Recommended env. variables\n\n| ENV. VAR | DEFAULT | VALUES |\n|----------|---------|--------|\n| $FLASK_ENV | development | production, development, testing | \n| $NODE_ENV | development | production, development, testing |\n| $POETRY_NO_DEV | False | True, False |\n| $GUNICORN_PID_FILE | /tmp/gunicorn.pid | --path-- |\n\n\n#### SQLAchemy problems?\n\nYou must adjust how SQAlchemy handles the connection pool to work correctly with gunicorn.\n\nThe simplest method is to disable the connection pool. This means that they are not recycled and a new connection is always opened:\n```python\nfrom sqlalchemy.pool import NullPool\n\ndb = SQLAlchemy(None, engine_options={'poolclass': NullPool})\n```\n\nMore info. here: https://docs.sqlalchemy.org/en/13/core/pooling.html#using-connection-pools-with-multiprocessing-or-os-fork\n\n\n#### Execute Flask CLI commands\n\nA safe way to do this is using the 'inv_poetry' script:\n```bash\ndocker-compose run --rm --entrypoint=\"\" \u003cFLASK_SERVICE_NAME\u003e inv_poetry \u003cCOMMAND\u003e\n```\n** Replace `\u003cFLASK_SERVICE_NAME\u003e` and `\u003cCOMMAND\u003e`\n\n\n#### Restart gunicorn workers\n\n```bash\ndocker-compose run --rm --entrypoint=\"\" \u003cFLASK_SERVICE_NAME\u003e restart_workers\n```\n** Replace `\u003cFLASK_SERVICE_NAME\u003e`\n\n\n#### Aditional Information\n\nThis image supports the expansion of secrets with the syntax.: `DOCKER-SECRET-\u003esecret_name`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftardo%2Fdocker-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftardo%2Fdocker-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftardo%2Fdocker-flask/lists"}