{"id":19216910,"url":"https://github.com/devilbox/docker-python-flask","last_synced_at":"2025-05-12T23:30:13.006Z","repository":{"id":74770507,"uuid":"224606849","full_name":"devilbox/docker-python-flask","owner":"devilbox","description":"Python Flask development Docker image","archived":false,"fork":false,"pushed_at":"2019-11-30T11:32:03.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T19:38:41.720Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devilbox.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,"zenodo":null}},"created_at":"2019-11-28T08:36:27.000Z","updated_at":"2022-02-15T21:58:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b3387e2-c1e6-4b24-ab0d-1f892a4f008b","html_url":"https://github.com/devilbox/docker-python-flask","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilbox%2Fdocker-python-flask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilbox%2Fdocker-python-flask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilbox%2Fdocker-python-flask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devilbox%2Fdocker-python-flask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devilbox","download_url":"https://codeload.github.com/devilbox/docker-python-flask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253839951,"owners_count":21972401,"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":"2024-11-09T14:19:17.004Z","updated_at":"2025-05-12T23:30:12.997Z","avatar_url":"https://github.com/devilbox.png","language":"Shell","readme":"# Python Flask Docker image\n\n[![Build Status](https://travis-ci.com/devilbox/docker-python-flask.svg?branch=master)](https://travis-ci.com/devilbox/docker-python-flask)\n[![Tag](https://img.shields.io/github/tag/devilbox/docker-python-flask.svg)](https://github.com/devilbox/docker-python-flask/releases)\n[![Gitter](https://badges.gitter.im/devilbox/Lobby.svg)](https://gitter.im/devilbox/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Discourse](https://img.shields.io/discourse/https/devilbox.discourse.group/status.svg?colorB=%234CB697)](https://devilbox.discourse.group)\n[![type](https://img.shields.io/badge/type-Docker-blue.svg)](https://hub.docker.com/r/devilbox/python-flask)\n[![License](https://img.shields.io/badge/license-MIT-%233DA639.svg)](https://opensource.org/licenses/MIT)\n\nThis project provides a Python Flask Docker image for development purposes.\n\nView **[Dockerfile](https://github.com/devilbox/docker-python-flask/blob/master/Dockerfile)** on GitHub.\n\n\n| Docker Hub | Upstream Project |\n|------------|------------------|\n| \u003ca href=\"https://hub.docker.com/r/devilbox/python-flask\"\u003e\u003cimg height=\"82px\" src=\"http://dockeri.co/image/devilbox/python-flask\" /\u003e\u003c/a\u003e | \u003ca href=\"https://github.com/cytopia/devilbox\" \u003e\u003cimg height=\"82px\" src=\"https://raw.githubusercontent.com/devilbox/artwork/master/submissions_banner/cytopia/01/png/banner_256_trans.png\" /\u003e\u003c/a\u003e |\n\n\n#### Documentation\n\nIn case you seek help, go and visit the community pages.\n\n\u003ctable width=\"100%\" style=\"width:100%; display:table;\"\u003e\n \u003cthead\u003e\n  \u003ctr\u003e\n   \u003cth width=\"33%\" style=\"width:33%;\"\u003e\u003ch3\u003e\u003ca target=\"_blank\" href=\"https://devilbox.readthedocs.io\"\u003eDocumentation\u003c/a\u003e\u003c/h3\u003e\u003c/th\u003e\n   \u003cth width=\"33%\" style=\"width:33%;\"\u003e\u003ch3\u003e\u003ca target=\"_blank\" href=\"https://gitter.im/devilbox/Lobby\"\u003eChat\u003c/a\u003e\u003c/h3\u003e\u003c/th\u003e\n   \u003cth width=\"33%\" style=\"width:33%;\"\u003e\u003ch3\u003e\u003ca target=\"_blank\" href=\"https://devilbox.discourse.group\"\u003eForum\u003c/a\u003e\u003c/h3\u003e\u003c/th\u003e\n  \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody style=\"vertical-align: middle; text-align: center;\"\u003e\n  \u003ctr\u003e\n   \u003ctd\u003e\n    \u003ca target=\"_blank\" href=\"https://devilbox.readthedocs.io\"\u003e\n     \u003cimg title=\"Documentation\" name=\"Documentation\" src=\"https://raw.githubusercontent.com/cytopia/icons/master/400x400/readthedocs.png\" /\u003e\n    \u003c/a\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ca target=\"_blank\" href=\"https://gitter.im/devilbox/Lobby\"\u003e\n     \u003cimg title=\"Chat on Gitter\" name=\"Chat on Gitter\" src=\"https://raw.githubusercontent.com/cytopia/icons/master/400x400/gitter.png\" /\u003e\n    \u003c/a\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003ca target=\"_blank\" href=\"https://devilbox.discourse.group\"\u003e\n     \u003cimg title=\"Devilbox Forums\" name=\"Forum\" src=\"https://raw.githubusercontent.com/cytopia/icons/master/400x400/discourse.png\" /\u003e\n    \u003c/a\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n  \u003ctd\u003e\u003ca target=\"_blank\" href=\"https://devilbox.readthedocs.io\"\u003edevilbox.readthedocs.io\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003ca target=\"_blank\" href=\"https://gitter.im/devilbox/Lobby\"\u003egitter.im/devilbox\u003c/a\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003ca target=\"_blank\" href=\"https://devilbox.discourse.group\"\u003edevilbox.discourse.group\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n## Docker image tags\n\n* **Image name:** `devilbox/python-flask`\n\n### Rolling tags\n\nRolling tags are updated and pushed nightly to ensure latest patch-level Python version.\n\n| Image tag | Python version |\n|-----------|----------------|\n| `3.8-dev` | Latest 3.8.x   |\n| `3.7-dev` | Latest 3.7.x   |\n| `3.6-dev` | Latest 3.6.x   |\n| `3.5-dev` | Latest 3.5.x   |\n| `2.7-dev` | Latest 2.7.x   |\n\n\n### Release tags\n\nRelease tags are fixed and bound to git tags.\n\n| Image Tag           | Python version |\n|---------------------|----------------|\n| `3.8-dev-\u003cgit-tag\u003e` | Latest 3.8.x   |\n| `3.7-dev-\u003cgit-tag\u003e` | Latest 3.7.x   |\n| `3.6-dev-\u003cgit-tag\u003e` | Latest 3.6.x   |\n| `3.5-dev-\u003cgit-tag\u003e` | Latest 3.5.x   |\n| `2.7-dev-\u003cgit-tag\u003e` | Latest 2.7.x   |\n\n\n## Example\n\nFor easy usage, there is a Docker Compose example project included.\n```bash\ncp .env.example .env\ndocker-compose up\n```\n```bash\ncurl localhost:3000\n```\n\n\n## Environment Variables\n\n| Variable         | Required | Default   | Description |\n|------------------|----------|-----------| ------------|\n| `FLASK_PROJECT`  | Yes      |           | The sub-directory name under `/shared/httpd/` to serve [1] |\n| `FLASK_APP_DIR`  |          | `app`     | The main entrypoint dir name |\n| `FLASK_APP_FILE` |          | `main.py` | The main entrypoint file name  |\n| `FLASK_PORT`     |          | `3000`    | Docker container internal http port to serve the application |\n| `NEW_UID`        |          | `1000`    | User id of the host system to ensure syncronized permissions between host and container |\n| `NEW_GID`        |          | `1000`    | Group id of the host system to ensure syncronized permissions between host and container |\n\n* [1] See [Project directory structure](#project-directory-structure) for usage\n\n\n## Project directory structure\n\nThe following shows how to organize your project on the host operating system.\n\n### Basic structure\n\nThe following is the least required directory structure:\n```bash\n\u003cproject-dir\u003e/\n└── app                      # Entrypoint dir name can be changed via env var [1]\n    └── main.py              # Entrypoint file name can be changed via env var [2]\n```\n\n* [1] Use the `FLASK_APP_DIR` environment variable to define the dir for the entrypoint in `\u003cproject-dir\u003e/app/`. Example: `FLASK_APP_DIR=src`.\n* [2] Use the `FLASK_APP_FILE` environment variable to define the file for the entrypoint in `\u003cproject-dir\u003e/app/main.py`. Example: `FLASK_APP_FILE=test.py`.\n\n\n### Structure with dependencies\n\nThe following directory structure allows for auto-installing Python dependencies during startup into a virtual env.\n```bash\n\u003cproject-dir\u003e/\n├── app                      # Entrypoint dir name can be changed via env var\n│   ├── __init__.py\n│   └── main.py              # Entrypoint file name can be changed via env var\n└── requirements.txt         # Optional: will pip install in virtual env\n```\n\nAfter you've started the container with a `requirements.txt` in place, a new `venv/` directory will be added with you Python virtual env.\n```bash\n\u003cproject-dir\u003e/\n├── app\n│   ├── __init__.py\n│   ├── main.py\n│   └── __pycache__\n├── requirements.txt\n└── venv\n    ├── bin\n    ├── include\n    └── lib\n```\n\n### Mounting your project\n\nWhen using this image, you need to mount your project directory into `/shared/httpd/` into the container:\n```bash\ndocker run \\\n  --rm \\\n  -v $(pwd)/\u003cproject-dir\u003e:/shared/httpd/\u003cproject-dir\u003e \\\n  devilbox/python-flask:3.9-dev\n```\n\nIf your local uid or gid are not 1000, you should set them accordingly via env vars to ensure to syncronize file system permissions across the container and your host system.\n```bash\ndocker run \\\n  --rm \\\n  -v $(pwd)/\u003cproject-dir\u003e:/shared/httpd/\u003cproject-dir\u003e \\\n  -e NEW_UID=$(id -u) \\\n  -e NEW_GID=$(id -g) \\\n  devilbox/python-flask:3.9-dev\n```\n\n\n## Build locally\n```bash\n# Build default version (Python 3.8)\nmake build\n\n# Build specific version\nmake build PYTHON=3.7\n```\n\n\n## Test locally\n```bash\n# Test default version (Python 3.8)\nmake test\n\n# Test specific version\nmake test PYTHON=3.7\n```\n\n\n## License\n\n**[MIT License](LICENSE)**\n\nCopyright (c) 2019 [cytopia](https://github.com/cytopia)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevilbox%2Fdocker-python-flask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevilbox%2Fdocker-python-flask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevilbox%2Fdocker-python-flask/lists"}