[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10886":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},10886,"uwsgi-nginx-flask-docker","tiangolo\u002Fuwsgi-nginx-flask-docker","tiangolo","Docker image with uWSGI and Nginx for Flask applications in Python running in a single container.","https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx-flask\u002F",null,"Python",3006,611,51,3,0,1,30.36,"Apache License 2.0",false,"master",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"debian","docker-container","docker-image","dockerfile","flask","flask-application","flask-image","nginx","nginx-server","python","python-flask","uwsgi","uwsgi-nginx","web","webapp","2026-06-12 02:02:28","## DEPRECATED 🚨\n\nThis Docker image is now deprecated. Read about it below.\n\n---\n\n[![Test](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Factions\u002Fworkflows\u002Ftest.yml) [![Deploy](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fworkflows\u002FDeploy\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Factions?query=workflow%3ADeploy)\n\n## Supported tags and respective `Dockerfile` links\n\n* [`python3.12`, `latest` _(Dockerfile)_](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fblob\u002Fmaster\u002Fdocker-images\u002Fpython3.12.dockerfile)\n* [`python3.11`, _(Dockerfile)_](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fblob\u002Fmaster\u002Fdocker-images\u002Fpython3.11.dockerfile)\n* [`python3.10` _(Dockerfile)_](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fblob\u002Fmaster\u002Fdocker-images\u002Fpython3.10.dockerfile)\n\n## Deprecated tags\n\n🚨 These tags are no longer supported or maintained, they are removed from the GitHub repository, but the last versions pushed might still be available in Docker Hub if anyone has been pulling them:\n\n* `python3.9`\n* `python3.8`\n* `python3.8-alpine`\n* `python3.7`\n* `python3.6`\n* `python2.7`\n\nThe last date tags for these versions are:\n\n* * `python3.9-2025-11-09`\n* `python3.8-2024-10-28`\n* `python3.8-alpine-2024-03-11`\n* `python3.7-2024-10-28`\n* `python3.6-2022-11-25`\n* `python2.7-2022-11-25`\n\n---\n\n**Note**: There are [tags for each build date](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx-flask\u002Ftags). If you need to \"pin\" the Docker image version you use, you can select one of those tags. E.g. `tiangolo\u002Fuwsgi-nginx-flask:python3.7-2019-10-14`.\n\n# uwsgi-nginx-flask\n\n**Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python** running in a single container.\n\n## Description\n\nThis [**Docker**](https:\u002F\u002Fwww.docker.com\u002F) image allows you to create [**Flask**](http:\u002F\u002Fflask.pocoo.org\u002F) web applications in [**Python**](https:\u002F\u002Fwww.python.org\u002F) that run with [**uWSGI**](https:\u002F\u002Fuwsgi-docs.readthedocs.org\u002Fen\u002Flatest\u002F) and [**Nginx**](http:\u002F\u002Fnginx.org\u002Fen\u002F) in a single container.\n\nThe combination of uWSGI with Nginx is a [common way to deploy Python Flask web applications](http:\u002F\u002Fflask.pocoo.org\u002Fdocs\u002F1.0\u002Fdeploying\u002Fuwsgi\u002F).\n\n---\n\n**GitHub repo**: [https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker)\n\n**Docker Hub image**: [https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx-flask\u002F](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx-flask\u002F)\n\n## 🚨 DEPRECATION WARNING\n\nYou are probably using **Kubernetes** or similar tools. In that case, you probably **don't need this image** (or any other **similar base image**). You are probably better off **building a Docker image from scratch**.\n\n---\n\nIf you have a cluster of machines with **Kubernetes**, Docker Swarm Mode, Nomad, or other similar complex system to manage distributed containers on multiple machines, then you will probably want to **handle replication** at the **cluster level** instead of using a **process manager** in each container that starts multiple **worker processes**, which is what this Docker image does.\n\nIn those cases (e.g. using Kubernetes) you would probably want to build a **Docker image from scratch**, installing your dependencies, and running **a single process** instead of this image.\n\nFor example, using [Gunicorn](https:\u002F\u002Fgunicorn.org\u002F) you could have a file `app\u002Fgunicorn_conf.py` with:\n\n```Python\n# Gunicorn config variables\nloglevel = \"info\"\nerrorlog = \"-\"  # stderr\naccesslog = \"-\"  # stdout\nworker_tmp_dir = \"\u002Fdev\u002Fshm\"\ngraceful_timeout = 120\ntimeout = 120\nkeepalive = 5\nthreads = 3\n```\n\nAnd then you could have a `Dockerfile` with:\n\n```Dockerfile\nFROM python:3.12\n\nWORKDIR \u002Fcode\n\nCOPY .\u002Frequirements.txt \u002Fcode\u002Frequirements.txt\n\nRUN pip install --no-cache-dir --upgrade -r \u002Fcode\u002Frequirements.txt\n\nCOPY .\u002Fapp \u002Fcode\u002Fapp\n\nCMD [\"gunicorn\", \"--conf\", \"app\u002Fgunicorn_conf.py\", \"--bind\", \"0.0.0.0:80\", \"app.main:app\"]\n```\n\nYou can read more about these ideas in the [FastAPI documentation about: FastAPI in Containers - Docker](https:\u002F\u002Ffastapi.tiangolo.com\u002Fdeployment\u002Fdocker\u002F#replication-number-of-processes) as the same ideas would apply to other web applications in containers.\n\n[uWSGI is now in maintenance mode](https:\u002F\u002Fuwsgi-docs.readthedocs.io\u002Fen\u002Flatest\u002F), so it's probably better to migrate to a different tool.\n\nAdditionally, I haven't used this Docker image in years, so I don't have much bandwidth to keep it up to date. Most of my time is dedicated to [FastAPI](https:\u002F\u002Ffastapi.tiangolo.com\u002F) and friends.\n\nYou can probably still use this image as-is, while you migrate to a different tool, but I won't be adding (and maintaining) support for new versions of Python.\n\n---\n\n## Historical Docs\n\nThe rest of the README is preserved mainly for historical reasons.\n\n## General Instructions\n\nYou don't have to clone this repo.\n\nYou can use this image as a base image for other images.\n\nAssuming you have a file `requirements.txt`, you could have a `Dockerfile` like this:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.12\n\nCOPY .\u002Frequirements.txt \u002Fapp\u002Frequirements.txt\n\nRUN pip install --no-cache-dir --upgrade -r \u002Fapp\u002Frequirements.txt\n\nCOPY .\u002Fapp \u002Fapp\n```\n\nThere are several image tags available but for new projects you should use the latest version available.\n\nThis Docker image is based on [**tiangolo\u002Fuwsgi-nginx**](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx\u002F). That Docker image has uWSGI and Nginx installed in the same container and was made to be the base of this image.\n\n## Quick Start\n\n* Go to your project directory\n* Create a `Dockerfile` with:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.12\n\nCOPY .\u002Fapp \u002Fapp\n```\n\n* Create an `app` directory and enter in it\n* Create a `main.py` file (it should be named like that and should be in your `app` directory) with:\n\n```python\nfrom flask import Flask\napp = Flask(__name__)\n\n@app.route(\"\u002F\")\ndef hello():\n    return \"Hello World from Flask\"\n\nif __name__ == \"__main__\":\n    # Only for debugging while developing\n    app.run(host='0.0.0.0', debug=True, port=80)\n```\n\nthe main application object should be named `app` (in the code) as in this example.\n\n**Note**: The section with the `main()` function is for debugging purposes. To learn more, read the **Advanced instructions** below.\n\n* You should now have a directory structure like:\n\n```\n.\n├── app\n│   └── main.py\n└── Dockerfile\n```\n\n* Go to the project directory (in where your `Dockerfile` is, containing your `app` directory)\n* Build your Flask image:\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\n...and you have an optimized Flask server in a Docker container.\n\nYou should be able to check it in your Docker container's URL, for example: \u003Ca href=\"http:\u002F\u002F192.168.99.100\" target=\"_blank\">http:\u002F\u002F192.168.99.100\u003C\u002Fa> or \u003Ca href=\"http:\u002F\u002F127.0.0.1\" target=\"_blank\">http:\u002F\u002F127.0.0.1\u003C\u002Fa>\n\n## Quick Start for SPAs *\n\n### Modern Single Page Applications\n\nIf you are building modern frontend applications (e.g. [Vue](https:\u002F\u002Fvuejs.org\u002F), [React](https:\u002F\u002Freactjs.org\u002F), [Angular](https:\u002F\u002Fangular.io\u002F)) you would most probably be compiling a modern version of JavaScript (ES2015, TypeScript, etc) to a less modern, more compatible version.\n\nIf you want to serve your (compiled) frontend code by the same backend (Flask) Docker container, you would have to copy the code to the container after compiling it.\n\nThat means that you would need to have all the frontend tools installed on the building machine (it might be your computer, a remote server, etc).\n\nThat also means that you would have to, somehow, always remember to compile the frontend code right before building the Docker image.\n\nAnd it might also mean that you could then have to add your compiled frontend code to your `git` repository (hopefully you are using Git already, or [learning how to use `git`](https:\u002F\u002Fwww.atlassian.com\u002Fgit)).\n\nAdding your compiled code to Git is a very bad idea for several reasons, some of those are:\n\n* You don't have a single, ultimate source of truth (the source code).\n* The compiled code might be stale, even when your source code is new, which might make you spend a lot of time debugging.\n* You might run into a lot of code conflicts when interacting with multiple team members with different Git branches, and spend a lot of time solving irrelevant code conflicts in the compiled code.\n    * This might also ruin automatic branch merging in pull requests from other team members.\n\nFor these reasons, it is not recommended that you serve your frontend code from the same backend (Flask) Docker container.\n\n### Better alternative\n\nThere's a much better alternative to serving your frontend code from the same backend (Flask) Docker container.\n\nYou can have another Docker container with all the frontend tools installed (Node.js, etc) that:\n\n* Takes your source frontend code.\n* Compiles it and generates the final \"distributable\" frontend.\n* Uses Docker \"multi-stage builds\" to copy that compiled code into a pure Nginx Docker image.\n* The final frontend image only contains the compiled frontend code, directly from the source, but has the small size of an Nginx image, with all the performance from Nginx.\n\nTo learn the specifics of this process for the frontend building in Docker you can read:\n\n* [React in Docker with Nginx, built with multi-stage Docker builds, including testing](https:\u002F\u002Fmedium.com\u002F@tiangolo\u002Freact-in-docker-with-nginx-built-with-multi-stage-docker-builds-including-testing-8cc49d6ec305)\n* [Angular in Docker with Nginx, supporting configurations \u002F environments, built with multi-stage Docker builds and testing with Chrome Headless](https:\u002F\u002Fmedium.com\u002F@tiangolo\u002Fangular-in-docker-with-nginx-supporting-environments-built-with-multi-stage-docker-builds-bb9f1724e984)\n\nAfter having one backend (Flask) container and one frontend container, you need to serve both of them.\n\nAnd you might want to serve them under the same domain, under a different path. For example, the backend (Flask) app at the path `\u002Fapi` and the frontend at the \"root\" path `\u002F`.\n\nYou can then use [Traefik](https:\u002F\u002Ftraefik.io\u002F) to handle that.\n\nAnd it can also automatically generate HTTPS certificates for your application using Let's Encrypt. All for free, in a very easy setup.\n\nIn this scenario, you would have 3 Docker containers:\n\n* Backend (Flask)\n* Frontend (Vue.js, Angular, React or any other)\n* Traefik (load balancer, HTTPS)\n\n## Quick Start for bigger projects structured as a Python package\n\nYou should be able to follow the same instructions as in the \"**QuickStart**\" section above, with some minor modifications:\n\n* Instead of putting your code in the `app\u002F` directory, put it in a directory `app\u002Fapp\u002F`.\n* Add an empty file `__init__.py` inside of that `app\u002Fapp\u002F` directory.\n* Add a file `uwsgi.ini` inside your `app\u002F` directory (that is copied to `\u002Fapp\u002Fuwsgi.ini` inside the container).\n* In your `uwsgi.ini` file, add:\n\n```ini\n[uwsgi]\nmodule = app.main\ncallable = app\n```\n\nThe explanation of the `uwsgi.ini` is as follows:\n\n* The module in where my Python web app lives is `app.main`. So, in the package `app` (`\u002Fapp\u002Fapp`), get the `main` module (`main.py`).\n* The Flask web application is the `app` object (`app = Flask(__name__)`).\n\nYour file structure would look like:\n\n```\n.\n├── app\n│   ├── app\n│   │   ├── __init__.py\n│   │   ├── main.py\n│   └── uwsgi.ini\n└── Dockerfile\n```\n\n...instead of:\n\n```\n.\n├── app\n│   ├── main.py\n└── Dockerfile\n```\n\nIf you are using static files in the same container, make sure the `STATIC_PATH` environment variable is set accordingly, for example to change the default value of `\u002Fapp\u002Fstatic` to `\u002Fapp\u002Fapp\u002Fstatic` you could add this line to your `Dockerfile`:\n\n```Dockerfile\nENV STATIC_PATH \u002Fapp\u002Fapp\u002Fstatic\n```\n\n...after that, everything should work as expected. All the other instructions would apply normally.\n\n### Working with submodules\n\n* After adding all your modules you could end up with a file structure similar to (taken from the example project):\n\n```\n.\n├── app\n│   ├── app\n│   │   ├── api\n│   │   │   ├── api.py\n│   │   │   ├── endpoints\n│   │   │   │   ├── __init__.py\n│   │   │   │   └── user.py\n│   │   │   ├── __init__.py\n│   │   │   └── utils.py\n│   │   ├── core\n│   │   │   ├── app_setup.py\n│   │   │   ├── database.py\n│   │   │   └── __init__.py\n│   │   ├── __init__.py\n│   │   ├── main.py\n│   │   └── models\n│   │       ├── __init__.py\n│   │       └── user.py\n│   └── uwsgi.ini\n└── Dockerfile\n```\n\n* Make sure you follow [the official docs while importing your modules](https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fmodules.html#intra-package-references):\n\n* For example, if you are in `app\u002Fapp\u002Fmain.py` and want to import the module in `app\u002Fapp\u002Fcore\u002Fapp_setup.py` you would write it like:\n\n```python\nfrom .core import app_setup\n```\n\nor\n\n```python\nfrom app.core import app_setup\n```\n\n* And if you are in `app\u002Fapp\u002Fapi\u002Fendpoints\u002Fuser.py` and you want to import the `users` object from `app\u002Fapp\u002Fcore\u002Fdatabase.py` you would write it like:\n\n```python\nfrom ...core.database import users\n```\n\nor\n\n```python\nfrom app.core.database import users\n```\n\n## Advanced instructions\n\nYou can customize several things using environment variables.\n\n### Serve `index.html` directly\n\n**Notice**: this technique is deprecated, as it can create several issues with modern frontend frameworks. For the details and better alternatives, read the section above.\n\nSetting the environment variable `STATIC_INDEX` to be `1` you can configure Nginx to serve the file in the URL `\u002Fstatic\u002Findex.html` when requested for `\u002F`.\n\nThat would improve speed as it would not involve uWSGI nor Python. Nginx would serve the file directly. To learn more follow the section above \"**QuickStart for SPAs**\".\n\nFor example, to enable it, you could add this to your `Dockerfile`:\n\n```Dockerfile\nENV STATIC_INDEX 1\n```\n\n### Custom uWSGI process number\n\nBy default, the image starts with 2 uWSGI processes running. When the server is experiencing a high load, it creates up to 16 uWSGI processes to handle it on demand.\n\nIf you need to configure these numbers you can use environment variables.\n\nThe starting number of uWSGI processes is controlled by the variable `UWSGI_CHEAPER`, by default set to `2`.\n\nThe maximum number of uWSGI processes is controlled by the variable `UWSGI_PROCESSES`, by default set to `16`.\n\nHave in mind that `UWSGI_CHEAPER` must be lower than `UWSGI_PROCESSES`.\n\nSo, if, for example, you need to start with 4 processes and grow to a maximum of 64, your `Dockerfile` could look like:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.12\n\nENV UWSGI_CHEAPER 4\nENV UWSGI_PROCESSES 64\n\nCOPY .\u002Fapp \u002Fapp\n```\n\n### Max upload file size\n\nYou can set a custom maximum upload file size using an environment variable `NGINX_MAX_UPLOAD`, by default it has a value of `0`, that allows unlimited upload file sizes. This differs from Nginx's default value of 1 MB. It's configured this way because that's the simplest experience an inexperienced developer in Nginx would expect.\n\nFor example, to have a maximum upload file size of 1 MB (Nginx's default) add a line in your `Dockerfile` with:\n\n```Dockerfile\nENV NGINX_MAX_UPLOAD 1m\n```\n\n### Custom listen port\n\nBy default, the container made from this image will listen on port 80.\n\nTo change this behavior, set the `LISTEN_PORT` environment variable. You might also need to create the respective `EXPOSE` Docker instruction.\n\nYou can do that in your `Dockerfile`, it would look something like:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.12\n\nENV LISTEN_PORT 8080\n\nEXPOSE 8080\n\nCOPY .\u002Fapp \u002Fapp\n```\n\n### Custom `uwsgi.ini` configurations\n\nThere is a default file in `\u002Fapp\u002Fuwsgi.ini` with app specific configurations (on top of the global `uwsgi` configurations).\n\nIt only contains:\n\n```ini\n[uwsgi]\nmodule = main\ncallable = app\n```\n\n* `module = main` refers to the file `main.py`.\n* `callable = app` refers to the `Flask` \"application\", in the variable `app`.\n\n---\n\nYou can customize `uwsgi` by replacing that file with your own, including all your configurations.\n\nFor example, to extend the default one above and enable threads, you could have a file:\n\n```ini\n[uwsgi]\nmodule = main\ncallable = app\nenable-threads = true\n```\n\n### Custom `uwsgi.ini` file location\n\nYou can override where the image should look for the app `uwsgi.ini` file using the environment variable `UWSGI_INI`.\n\nWith that you could change the default directory for your app from `\u002Fapp` to something else, like `\u002Fapplication`.\n\nFor example, to make the image use the file in `\u002Fapplication\u002Fuwsgi.ini`, you could add this to your `Dockerfile`:\n\n```Dockerfile\nENV UWSGI_INI \u002Fapplication\u002Fuwsgi.ini\n\nCOPY .\u002Fapplication \u002Fapplication\nWORKDIR \u002Fapplication\n```\n\n**Note**: the `WORKDIR` is important, otherwise uWSGI will try to run the app in `\u002Fapp`.\n\n**Note**: you would also have to configure the `static` files path, read below.\n\n### Custom `.\u002Fstatic\u002F` path\n\nYou can make Nginx use a custom directory path with the files to serve directly (without having uWSGI involved) with the environment variable `STATIC_PATH`.\n\nFor example, to make Nginx serve the static content using the files in `\u002Fapp\u002Fcustom_static\u002F` you could add this to your `Dockerfile`:\n\n```Dockerfile\nENV STATIC_PATH \u002Fapp\u002Fcustom_static\n```\n\nThen, when the browser asked for a file in, for example, http:\u002F\u002Fexample.com\u002Fstatic\u002Findex.html, Nginx would answer directly using a file in the path `\u002Fapp\u002Fcustom_static\u002Findex.html`.\n\n**Note**: you would also have to configure Flask to use that as its `static` directory.\n\n---\n\nAs another example, if you needed to put your application code in a different directory, you could configure Nginx to serve those static files from that different directory.\n\nIf you needed to have your static files in `\u002Fapplication\u002Fstatic\u002F` you could add this to your `Dockerfile`:\n\n```Dockerfile\nENV STATIC_PATH \u002Fapplication\u002Fstatic\n```\n\n### Custom `\u002Fstatic` URL\n\nYou can also make Nginx serve the static files in a different URL, for that, you can use the environment variable `STATIC_URL`.\n\nFor example, if you wanted to change the URL `\u002Fstatic` to `\u002Fcontent` you could add this to your `Dockerfile`:\n\n```Dockerfile\nENV STATIC_URL \u002Fcontent\n```\n\nThen, when the browser asked for a file in, for example, http:\u002F\u002Fexample.com\u002Fcontent\u002Findex.html, Nginx would answer directly using a file in the path `\u002Fapp\u002Fstatic\u002Findex.html`.\n\n### Custom `\u002Fapp\u002Fprestart.sh`\n\nIf you need to run anything before starting the app, you can add a file `prestart.sh` to the directory `\u002Fapp`. The image will automatically detect and run it before starting everything.\n\nFor example, if you want to add Alembic SQL migrations (with SQLAlchemy), you could create a `.\u002Fapp\u002Fprestart.sh` file in your code directory (that will be copied by your `Dockerfile`) with:\n\n```bash\n#! \u002Fusr\u002Fbin\u002Fenv bash\n\n# Let the DB start\nsleep 10;\n# Run migrations\nalembic upgrade head\n```\n\nand it would wait 10 seconds to give the database some time to start and then run that `alembic` command.\n\nIf you need to run a Python script before starting the app, you could make the `\u002Fapp\u002Fprestart.sh` file run your Python script, with something like:\n\n```bash\n#! \u002Fusr\u002Fbin\u002Fenv bash\n\n# Run custom Python script before starting\npython \u002Fapp\u002Fmy_custom_prestart_script.py\n```\n\n**Note**: The image uses `source` to run the script, so for example, environment variables would persist. If you don't understand the previous sentence, you probably don't need it.\n\n### Custom Nginx processes number\n\nBy default, Nginx will start one \"worker process\".\n\nIf you want to set a different number of Nginx worker processes you can use the environment variable `NGINX_WORKER_PROCESSES`.\n\nYou can use a specific single number, e.g.:\n\n```Dockerfile\nENV NGINX_WORKER_PROCESSES 2\n```\n\nor you can set it to the keyword `auto` and it will try to auto-detect the number of CPUs available and use that for the number of workers.\n\nFor example, using `auto`, your Dockerfile could look like:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.12\n\nENV NGINX_WORKER_PROCESSES auto\n\nCOPY .\u002Fapp \u002Fapp\n```\n\n### Custom Nginx maximum connections per worker\n\nBy default, Nginx will start with a maximum limit of 1024 connections per worker.\n\nIf you want to set a different number you can use the environment variable `NGINX_WORKER_CONNECTIONS`, e.g:\n\n```Dockerfile\nENV NGINX_WORKER_CONNECTIONS 2048\n```\n\nIt cannot exceed the current limit on the maximum number of open files. See how to configure it in the next section.\n\n### Custom Nginx maximum open files\n\nThe number connections per Nginx worker cannot exceed the limit on the maximum number of open files.\n\nYou can change the limit of open files with the environment variable `NGINX_WORKER_OPEN_FILES`, e.g.:\n\n```Dockerfile\nENV NGINX_WORKER_OPEN_FILES 2048\n```\n\n### Customizing Nginx additional configurations\n\nIf you need to configure Nginx further, you can add `*.conf` files to `\u002Fetc\u002Fnginx\u002Fconf.d\u002F` in your `Dockerfile`.\n\nJust have in mind that the default configurations are created during startup in a file at `\u002Fetc\u002Fnginx\u002Fconf.d\u002Fnginx.conf` and `\u002Fetc\u002Fnginx\u002Fconf.d\u002Fupload.conf`. So you shouldn't overwrite them. You should name your `*.conf` file with something different than `nginx.conf` or `upload.conf`, for example: `custom.conf`.\n\n**Note**: if you are customizing Nginx, maybe copying configurations from a blog or a StackOverflow answer, have in mind that you probably need to use the [configurations specific to uWSGI](http:\u002F\u002Fnginx.org\u002Fen\u002Fdocs\u002Fhttp\u002Fngx_http_uwsgi_module.html), instead of those for other modules, like for example, `ngx_http_fastcgi_module`.\n\n### Overriding Nginx configuration completely\n\nIf you need to configure Nginx even further, completely overriding the defaults, you can add a custom Nginx configuration to `\u002Fapp\u002Fnginx.conf`.\n\nIt will be copied to `\u002Fetc\u002Fnginx\u002Fnginx.conf` and used instead of the generated one.\n\nHave in mind that, in that case, this image won't generate any of the Nginx configurations, it will only copy and use your configuration file.\n\nThat means that all the environment variables described above that are specific to Nginx won't be used.\n\nIt also means that it won't use additional configurations from files in `\u002Fetc\u002Fnginx\u002Fconf.d\u002F*.conf`, unless you explicitly have a section in your custom file `\u002Fapp\u002Fnginx.conf` with:\n\n```conf\ninclude \u002Fetc\u002Fnginx\u002Fconf.d\u002F*.conf;\n```\n\nIf you want to add a custom `\u002Fapp\u002Fnginx.conf` file but don't know where to start from, you can use [the `nginx.conf` used for the tests](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fblob\u002Fmaster\u002Ftests\u002Ftest_02_app\u002Fcustom_nginx_app\u002Fapp\u002Fnginx.conf) and customize it or modify it further.\n\n## Technical details\n\nThe combination of uWSGI with Nginx is a [common way to deploy Python Flask web applications](http:\u002F\u002Fflask.pocoo.org\u002Fdocs\u002F1.0\u002Fdeploying\u002Fuwsgi\u002F).\n\nRoughly:\n\n* **Nginx** is a web server, it takes care of the HTTP connections and also can serve static files directly and more efficiently.\n\n* **uWSGI** is an application server, that's what runs your Python code and it talks with Nginx.\n\n* **Your Python code** has the actual **Flask** web application, and is run by uWSGI.\n\nThe image [**tiangolo\u002Fuwsgi-nginx**](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx\u002F) takes advantage of already existing slim and optimized Docker images (based on Debian as [recommended by Docker](https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Fuserguide\u002Feng-image\u002Fdockerfile_best-practices\u002F)) and implements several of Docker's best practices.\n\nIt uses the official Python Docker image, installs uWSGI and on top of that (with the least amount of modifications) adds the official Nginx image.\n\nAnd it controls all these processes with Supervisord.\n\nThe image (and tags) created by this repo is based on the image [**tiangolo\u002Fuwsgi-nginx**](https:\u002F\u002Fhub.docker.com\u002Fr\u002Ftiangolo\u002Fuwsgi-nginx\u002F). This image adds Flask and sensible defaults on top of it.\n\nIf you follow the instructions and keep the root directory `\u002Fapp` in your container, with a file named `main.py` and a Flask object named `app` in it, it should \"just work\".\n\nThere's already a `uwsgi.ini` file in the `\u002Fapp` directory with the uWSGI configurations for it to \"just work\". And all the other required parameters are in another `uwsgi.ini` file in the image, inside `\u002Fetc\u002Fuwsgi\u002F`.\n\nIf you need to change the main file name or the main Flask object, you would have to provide your own `uwsgi.ini` file. You may use the one in this repo as a template to start with (and you only would have to change the 2 corresponding lines).\n\nYou can have a `\u002Fapp\u002Fstatic` directory and those files will be efficiently served by Nginx directly (without going through your Flask code or even uWSGI), it's already configured for you. But you can configure it further using environment variables (read above).\n\nSupervisord takes care of running uWSGI with the `uwsgi.ini` file in `\u002Fapp` file (including also the file in `\u002Fetc\u002Fuwsgi\u002Fuwsgi.ini`) and starting Nginx.\n\n---\n\nThere's the rule of thumb that you should have \"one process per container\".\n\nThat helps, for example, isolating an app and its database in different containers.\n\nBut if you want to have a \"micro-services\" approach you may want to [have more than one process in one container](https:\u002F\u002Fvaldhaus.co\u002Fwritings\u002Fdocker-misconceptions\u002F) if they are all related to the same \"service\", and you may want to include your Flask code, uWSGI and Nginx in the same container (and maybe run another container with your database).\n\nThat's the approach taken in this image.\n\n---\n\nThis image (and tags) have some default files, so if you run it by itself (not as the base image of your own project) you will see a default \"Hello World\" web app.\n\nWhen you build a `Dockerfile` with a `COPY .\u002Fapp \u002Fapp` you replace those default files with your app code.\n\nThe main default file is only in `\u002Fapp\u002Fmain.py`. And in the case of the tags with `-index`, also in `\u002Fapp\u002Fstatic\u002Findex.html`.\n\nBut those files render a \"(default)\" text in the served web page, so that you can check if you are seeing the default code or your own code overriding the default.\n\nYour app code should be in the container's `\u002Fapp` directory, it should have a `main.py` file and that `main.py` file should have a Flask object `app`.\n\nIf you follow the instructions above or use one of the downloadable example templates, you should be OK.\n\nThere is also a `\u002Fapp\u002Fuwsgi.ini` file inside the images with the default parameters for uWSGI.\n\nThe downloadable examples include a copy of the same `uwsgi.ini` file for debugging purposes. To learn more, read the \"**Advanced development instructions**\" below.\n\n## Advanced development instructions\n\nWhile developing, you might want to make your code directory a volume in your Docker container.\n\nWith that you would have your files (temporarily) updated every time you modify them, without needing to build your container again.\n\nTo do this, you can use the command `pwd` (print working directory) inside your `docker run` and the flag `-v` for volumes.\n\nWith that you could map your `.\u002Fapp` directory to your container's `\u002Fapp` directory.\n\nBut first, as you will be completely replacing the directory `\u002Fapp` in your container (and all of its contents) you will need to have a `uwsgi.ini` file in your `.\u002Fapp` directory with:\n\n```ini\n[uwsgi]\nmodule = main\ncallable = app\n```\n\nand then you can do the Docker volume mapping.\n\n**Note**: A `uwsgi.ini` file is included in the downloadable examples.\n\n* To try it, go to your project directory (the one with your `Dockerfile` and your `.\u002Fapp` directory)\n* Make sure you have a `uwsgi.ini` file in your `.\u002Fapp` directory\n* Build your Docker image:\n\n```bash\ndocker build -t myimage .\n```\n\n* Run a container based on your image, mapping your code directory (`.\u002Fapp`) to your container's `\u002Fapp` directory:\n\n```bash\ndocker run -d --name mycontainer -p 80:80 -v $(pwd)\u002Fapp:\u002Fapp myimage\n```\n\nIf you go to your Docker container URL you should see your app, and you should be able to modify files in `.\u002Fapp\u002Fstatic\u002F` and see those changes reflected in your browser just by reloading.\n\n...but, as uWSGI loads your whole Python Flask web application once it starts, you won't be able to edit your Python Flask code and see the changes reflected.\n\nTo be able to (temporarily) debug your Python Flask code live, you can run your container overriding the default command (that starts Supervisord which in turn starts uWSGI and Nginx) and run your application directly with `python`, in debug mode, using the `flask` command with its environment variables.\n\nSo, with all the modifications above and making your app run directly with `flask`, the final Docker command would be:\n\n ```bash\ndocker run -d --name mycontainer -p 80:80 -v $(pwd)\u002Fapp:\u002Fapp -e FLASK_APP=main.py -e FLASK_DEBUG=1 myimage flask run --host=0.0.0.0 --port=80\n```\n\nOr in the case of a package project, you would set `FLASK_APP=main\u002Fmain.py`:\n\n```bash\ndocker run -d --name mycontainer -p 80:80 -v $(pwd)\u002Fapp:\u002Fapp -e FLASK_APP=main\u002Fmain.py -e FLASK_DEBUG=1 myimage flask run --host=0.0.0.0 --port=80\n```\n\nNow you can edit your Flask code in your local machine and once you refresh your browser, you will see the changes live.\n\nRemember that you should use this only for debugging and development, for deployment in production you shouldn't mount volumes and you should let Supervisord start and let it start uWSGI and Nginx (which is what happens by default).\n\nAn alternative for these last steps to work when you don't have a package, but just a flat structure with single files (modules), your Python Flask code could have that section with:\n\n```python\nif __name__ == \"__main__\":\n   # Only for debugging while developing\n   app.run(host='0.0.0.0', debug=True, port=80)\n```\n\n...and you could run it with `python main.py`. But that will only work when you are not using a package structure and don't plan to do it later. In that specific case, if you didn't add the code block above, your app would only listen to `localhost` (inside the container), in another port (5000) and not in debug mode.\n\n---\n\nAlso, if you want to do the same live debugging using the environment variable `STATIC_INDEX=1` (to serve `\u002Fapp\u002Fstatic\u002Findex.html` directly when requested for `\u002F`) your Nginx won't serve it directly as it won't be running (only your Python Flask app in debug mode will be running).\n\n```python\nfrom flask import Flask, send_file\n```\n\nand\n\n```python\n@app.route('\u002F')\ndef route_root():\n    index_path = os.path.join(app.static_folder, 'index.html')\n    return send_file(index_path)\n```\n\n...that makes sure your app also serves the `\u002Fapp\u002Fstatic\u002Findex.html` file when requested for `\u002F`. Or if you are using a package structure, the `\u002Fapp\u002Fmain\u002Fstatic\u002Findex.html` file.\n\nAnd if you are using a SPA framework, to allow it to handle the URLs in the browser, your Python Flask code should have the section with:\n\n```python\n# Everything not declared before (not a Flask route \u002F API endpoint)...\n@app.route('\u002F\u003Cpath:path>')\ndef route_frontend(path):\n    # ...could be a static file needed by the front end that\n    # doesn't use the `static` path (like in `\u003Cscript src=\"bundle.js\">`)\n    file_path = os.path.join(app.static_folder, path)\n    if os.path.isfile(file_path):\n        return send_file(file_path)\n    # ...or should be handled by the SPA's \"router\" in front end\n    else:\n        index_path = os.path.join(app.static_folder, 'index.html')\n        return send_file(index_path)\n```\n\n...that makes Flask send all the CSS, JavaScript and image files when requested in the root (`\u002F`) URL but also makes sure that your frontend SPA handles all the other URLs that are not defined in your Flask app.\n\nThat's how it is written in the tutorial above and is included in the downloadable examples.\n\n## More advanced development instructions\n\nIf you follow the instructions above, it's probable that at some point, you will write code that will break your Flask debugging server and it will crash.\n\nAnd since the only process running was your debugging server, that now is stopped, your container will stop.\n\nThen you will have to start your container again after fixing your code and you won't see very easily what is the error that is crashing your server.\n\nSo, while developing, you could do the following (that's what I normally do, although I do it with Docker Compose, as in the example projects):\n\n* Make your container run and keep it alive in an infinite loop (without running any server):\n\n```bash\ndocker run -d --name mycontainer -p 80:80 -v $(pwd)\u002Fapp:\u002Fapp -e FLASK_APP=main.py -e FLASK_DEBUG=1 myimage bash -c \"while true ; do sleep 10 ; done\"\n```\n\n* Or, if your project is a package, set `FLASK_APP=main\u002Fmain.py`:\n\n```bash\ndocker run -d --name mycontainer -p 80:80 -v $(pwd)\u002Fapp:\u002Fapp -e FLASK_APP=main\u002Fmain.py -e FLASK_DEBUG=1 myimage bash -c \"while true ; do sleep 10 ; done\"\n```\n\n* Connect to your container with a new interactive session:\n\n```bash\ndocker exec -it mycontainer bash\n```\n\nYou will now be inside your container in the `\u002Fapp` directory.\n\n* Now, from inside the container, run your Flask debugging server:\n\n```bash\nflask run --host=0.0.0.0 --port=80\n```\n\nYou will see your Flask debugging server start, you will see how it sends responses to every request, you will see the errors thrown when you break your code, and how they stop your server, and you will be able to re-start it very fast, by just running the command above again.\n\n## Tests\n\nAll the image tags, configurations, environment variables and application options are tested.\n\n## Release Notes\n\n### Latest Changes\n\n#### Features\n\n* ✨ Add Python 3.12. PR [#386](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F386) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Upgrades\n\n* Bump flask from 3.1.2 to 3.1.3 in \u002Fdocker-images. PR [#408](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F408) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump flask from 3.1.1 to 3.1.2. PR [#397](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F397) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* Bump flask from 3.1.0 to 3.1.1 in \u002Fdocker-images. PR [#393](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F393) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump flask from 2.2.5 to 3.1.0. PR [#391](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F391) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 🔥 Drop support for Python 3.7 and 3.8. PR [#388](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F388) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Docs\n\n* 📝 Add note about historical README. PR [#403](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F403) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 📝 Add deprecation note. PR [#402](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F402) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Internal\n\n* ⬆ Bump actions\u002Fcheckout from 5 to 6. PR [#405](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F405) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump peter-evans\u002Fdockerhub-description from 4 to 5. PR [#404](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F404) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Upgrade actions\u002Fcheckout from v5 to v6. PR [#407](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F407) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Upgrade `latest-changes` GitHub Action and pin `actions\u002Fcheckout@v5`. PR [#406](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F406) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 🔥 Drop support for Python 3.9. PR [#401](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F401) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆ Bump tiangolo\u002Fissue-manager from 0.5.1 to 0.6.0. PR [#400](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F400) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump actions\u002Flabeler from 5 to 6. PR [#399](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F399) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump actions\u002Fsetup-python from 5 to 6. PR [#398](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F398) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump actions\u002Fcheckout from 4 to 5. PR [#396](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F396) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump tiangolo\u002Flatest-changes from 0.3.2 to 0.4.0. PR [#395](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F395) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Add CI Labeler. PR [#392](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F392) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆ Bump tiangolo\u002Flatest-changes from 0.3.1 to 0.3.2. PR [#390](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F390) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 🔥 Remove old unused files. PR [#389](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F389) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆ Bump tiangolo\u002Fissue-manager from 0.5.0 to 0.5.1. PR [#387](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F387) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Update `issue-manager.yml`. PR [#385](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F385) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Update `latest-changes` GitHub Action. PR [#360](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F360) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆ Bump docker\u002Fbuild-push-action from 5 to 6. PR [#359](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F359) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump docker\u002Flogin-action from 1 to 3. PR [#352](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F352) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump docker\u002Fsetup-buildx-action from 1 to 3. PR [#351](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F351) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump docker\u002Fbuild-push-action from 2 to 5. PR [#350](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F350) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump actions\u002Fsetup-python from 4 to 5. PR [#349](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F349) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Update issue-manager.yml GitHub Action permissions. PR [#357](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F357) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 🔧  Add GitHub templates for discussions and issues, and security policy. PR [#354](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F354) by [@alejsdev](https:\u002F\u002Fgithub.com\u002Falejsdev).\n* 🔧 Update `latest-changes.yml`. PR [#348](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F348) by [@alejsdev](https:\u002F\u002Fgithub.com\u002Falejsdev).\n\n### 2.1.0\n\n#### Features\n\n* ✨ Add support for multiarch builds, including ARM (e.g. Mac M1). PR [#347](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F347) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Refactors\n\n* 🔥 Remove Alpine support. PR [#345](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F345) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Docs\n\n* ✏️ Fix typo in README. PR [#316](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F316) by [@cclauss](https:\u002F\u002Fgithub.com\u002Fcclauss).\n* 📝 Update test badge in `README.md`. PR [#346](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F346) by [@alejsdev](https:\u002F\u002Fgithub.com\u002Falejsdev).\n\n#### Upgrades\n\n* ⬆️ Bump flask from 2.2.3 to 2.2.5 in \u002Fdocker-images. PR [#327](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F327) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Bump flask from 2.2.2 to 2.2.3. PR [#321](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F321) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n\n#### Internal\n\n* 👷 Update latest-changes GitHub Action. PR [#335](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F335) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆️ Update mypy requirement from ^0.991 to ^1.1. PR [#322](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F322) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update black requirement from ^22.10 to ^23.1. PR [#319](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F319) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Bump actions\u002Fsetup-python from 4.3.0 to 4.5.0. PR [#318](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F318) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Update token for latest changes. PR [#326](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F326) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Add GitHub Action for Docker Hub description. PR [#313](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F313) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆ Bump actions\u002Fsetup-python from 4.7.1 to 5.0.0. PR [#338](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F338) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump peter-evans\u002Fdockerhub-description from 3 to 4. PR [#341](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F341) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆ Bump tiangolo\u002Fissue-manager from 0.4.0 to 0.5.0. PR [#342](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F342) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Update dependabot. PR [#336](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F336) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆️ Bump actions\u002Fsetup-python from 4.5.0 to 4.7.1. PR [#333](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F333) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Bump actions\u002Fcheckout from 3 to 4. PR [#332](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F332) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n\n### 2.0.0\n\nHighlights of this release:\n\n* Support for Python 3.10, 3.11, and 3.9.\n* Deprecation of Python 3.6 and 2.7.\n    * The last Python 3.6 and 2.7 images are available in Docker Hub, but they won't be updated or maintained anymore.\n    * The last images with a date tag are `python3.6-2022-11-25` and `python2.7-2022-11-25`.\n* Upgraded versions of all the dependencies.\n* Small improvements and fixes.\n\n#### Features\n\n* ✨ Add support for Python 3.11. PR [#312](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F312) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ✨ Add support for Python 3.10. PR [#253](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F253) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ♻ Add pip flag --no-cache-dir to reduce disk size used. PR [#242](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F242) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ✨ Add Python 3.9 image. PR [#232](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F232) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Breaking Changes\n\n* 🔥 Deprecate and remove Python 3.6. PR [#304](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F304) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 🔥 Remove support for Python 2.7. PR [#246](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F246) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Upgrades\n\n* ⬆️ Bump flask from 2.0.1 to 2.2.2 in \u002Fdocker-images. PR [#296](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F296) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Upgrade Flask to the latest version to support Python 3.6. PR [#301](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F301) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆️ Upgrade Nginx and Alpine (in the base images). PR [#283](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F283) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n#### Docs\n\n* ✏️ Fix typo: otherwhise -> otherwise in README. PR [#211](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F211) by [@timgates42](https:\u002F\u002Fgithub.com\u002Ftimgates42).\n* 📝 Add note to discourage Alpine with Python. PR [#247](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F247) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 📝 Add Kubernetes warning, when to use this image. PR [#245](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F245) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ✏️ ️Fix typo duplicate \"Note\" in Readme. PR [#243](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F243) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* Fix example for Python 3.8. PR [#186](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F186) by [@ericboucher](https:\u002F\u002Fgithub.com\u002Fericboucher).\n\n#### Internal\n\n* ⬆️ Update autoflake requirement from ^1.3.1 to ^2.0.0. PR [#307](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F307) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update black requirement from ^20.8b1 to ^22.10. PR [#308](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F308) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update docker requirement from ^5.0.3 to ^6.0.1. PR [#309](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F309) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update mypy requirement from ^0.971 to ^0.991. PR [#310](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F310) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Upgrade CI OS. PR [#311](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F311) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 🔧 Update Dependabot config. PR [#306](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F306) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 🔥 Remove Travis backup file. PR [#254](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F254) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆️ Bump tiangolo\u002Fissue-manager from 0.2.0 to 0.4.0. PR [#234](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F234) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Add scheduled CI. PR [#303](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F303) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Add alls-green GitHub Action. PR [#302](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F302) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* ⬆️ Bump actions\u002Fsetup-python from 4.2.0 to 4.3.0. PR [#299](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F299) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update black requirement from ^19.10b0 to ^20.8b1. PR [#236](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F236) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update docker requirement from ^4.2.0 to ^5.0.3. PR [#250](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F250) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update isort requirement from ^4.3.21 to ^5.8.0. PR [#237](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F237) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update pytest requirement from ^5.4.1 to ^7.0.1. PR [#270](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F270) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Bump actions\u002Fcheckout from 2 to 3.1.0. PR [#298](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F298) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Update mypy requirement from ^0.770 to ^0.971. PR [#292](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F292) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* ⬆️ Bump actions\u002Fsetup-python from 1 to 4.2.0. PR [#293](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F293) by [@dependabot[bot]](https:\u002F\u002Fgithub.com\u002Fapps\u002Fdependabot).\n* 👷 Run tests only on PRs or when pushing on master to avoid double CI. PR [#284](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F284) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Update Latest Changes GitHub Action. PR [#241](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F241) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Add Dependabot and external dependencies to get automated upgrade PRs. PR [#233](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F233) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n* 👷 Add GitHub Action latest-changes. PR [#210](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F210) by [@tiangolo](https:\u002F\u002Fgithub.com\u002Ftiangolo).\n\n### 1.4.0\n\n* Add [GitHub Sponsors](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Ftiangolo) button. PR [#177](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F177).\n* Add Python 3.8 and Alpine with Python 3.8. This also includes all the recent updates of the parent image, like:\n    * Latest version of Nginx, `1.17.10`.\n    * Latest version of Debian, Buster.\n    * Latest version of Alpine, `3.11`.\n    * PR [#176](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F176).\n* Remove support for Python 3.5. PR [#175](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F175).\n* Refactor build setup:\n    * Move to GitHub actions.\n    * Re-use and simplify code and configs.\n    * Simplify and update tests.\n    * Remove deprecated `-index` sufix tags.\n    * PR [#173](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F173).\n\n### 1.3.0\n\n* This is the last version to support:\n    * Debian Stretch (before upgrading to Buster).\n    * Python 3.5.\n    * Alpine 3.7 and 3.8 (before upgrading to Alpine 3.11).\n    * Alpine in older versions of Python, 2.7 and 3.6 (Before upgrading to Python 3.8).\n    * Tags with `-index` (use `ENV STATIC_INDEX 1` instead).\n    * If you need any of those, make sure to use a tag for the build date `2020-05-04`.\n\n### 1.2.1\n\n* Add note about static path in bigger projects. PR [#150](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F150) by [@reka169](https:\u002F\u002Fgithub.com\u002Freka169).\n* Fix missing import in example. PR [#141](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F141) by [@Boyu1997](https:\u002F\u002Fgithub.com\u002FBoyu1997).\n\n### 1.2.0\n\n* Refactor tests to use env vars and add image tags for each build date, like `tiangolo\u002Fuwsgi-nginx-flask:python3.8-2019-10-14`. PR [#154](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F154).\n* Upgrade Travis. PR [#135](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F135).\n\n### 1.1.0\n\n* Move `\u002Fstart.sh` and `\u002Fapp\u002Fprestart.sh` functionality to parent image. [PR #134](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F134).\n\n### 1.0.0\n\n2019-02-02:\n\n* The Nginx configurations are generated dynamically from the entrypoint, instead of modifying pre-existing files. [PR #50 in the parent image `uwsgi-nginx`](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-docker\u002Fpull\u002F50) and [PR #121](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F121).\n* Support for a completely custom `\u002Fapp\u002Fnginx.conf` file that overrides the generated one. [PR #51 in the parent image `uwsgi-nginx`](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-docker\u002Fpull\u002F51) and [PR #122](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F122).\n\n2019-01-01:\n\n* Improved guide for single page applications.\n* Links to project generators.\n\n2018-12-29:\n\n* Travis integration, images built and pushed by Travis.\n* Fixes in parent image for Nginx.\n\n2018-11-23:\n\n* New Alpine 3.8 images for Python 2.7, Python 3.6 and (temporarily disabled) Python 3.7.\n\n2018-09-22:\n\n* New Python 3.7 images, based on standard Debian and Alpine Linux. All the documentation and project templates have been updated to use Python 3.7 by default. Thanks to [desaintmartin](https:\u002F\u002Fgithub.com\u002Fdesaintmartin) in [this PR](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F82).\n\n2018-06-22:\n\n* You can now use `NGINX_WORKER_CONNECTIONS` to set the maximum number of Nginx worker connections and `NGINX_WORKER_OPEN_FILES` to set the maximum number of open files. Thanks to [ronlut](https:\u002F\u002Fgithub.com\u002Fronlut) in [this PR](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fpull\u002F56).\n\n2018-06-22:\n\nImprovements from parent image:\n\n* Make uWSGI require an app to run, instead of going in \"full dynamic mode\" while there was an error. Supervisord doesn't terminate itself but tries to restart uWSGI and shows the errors. Uses `need-app` as suggested by [luckydonald](https:\u002F\u002Fgithub.com\u002Fluckydonald) in [this comment](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker\u002Fissues\u002F3#issuecomment-321991279).\n\n* Correctly handled graceful shutdown of uWSGI and Nginx. Thanks to [desaintmartin](https:\u002F\u002Fgithub.com\u002Fdesaintmartin) in [this PR](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-docker\u002Fpull\u002F30).\n\n2018-02-04:\n\nIt's now possible to set the number of Nginx worker processes with the environment variable `NGINX_WORKER_PROCESSES`. Thanks to [naktinis](https:\u002F\u002Fgithub.com\u002Fnaktinis) in [this PR](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-docker\u002Fpull\u002F22).\n\n2018-01-14:\n\n* There are now two Alpine based versions, `python2.7-alpine3.7` and `python3.6-alpine3.7`.\n\n2017-12-10:\n\n* Added support for `\u002Fapp\u002Fprestart.sh` script to run arbitrary code before starting the app (for example, Alembic - SQLAlchemy migrations). The [documentation for the `\u002Fapp\u002Fprestart.sh` is in the main README](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-flask-docker#custom-appprestartsh).\n* `\u002Fapp` is part of the `PYTHONPATH` environment variable. That allows global imports from several places, easier Alembic integration, etc.\n\n2017-12-08: Now you can configure which port the container should listen on, using the environment variable `LISTEN_PORT` thanks to [tmshn](https:\u002F\u002Fgithub.com\u002Ftmshn) in [this PR](https:\u002F\u002Fgithub.com\u002Ftiangolo\u002Fuwsgi-nginx-docker\u002Fpull\u002F16).\n\n2017-09-10: Updated examples and sample project to work with SPAs even when structuring the app as a package (with subdirectories).\n\n2017-09-02:\n\n* Example project with a [Python package](https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fmodules.html#packages) structure and a section explaining how to use it and structure a Flask project like that.\n* Also, the examples and documentation now use the [`flask run`](http:\u002F\u002Fflask.pocoo.org\u002Fdocs\u002F0.12\u002Fquickstart\u002F#a-minimal-application) commands, that allows running a package application while developing more easily.\n\n2017-08-10: Many changes:\n\n* New official image tags: `python3.6`, `python3.6-index`, `python.3.5`, `python3.5-index`, `python2.7` and `python2.7-index`. All the other images are deprecated in favor is this ones.\n* Python 3.6 is now the recommended default. Even the example projects for other versions were removed to discourage using older Python versions for new projects.\n* Any of the older images that didn't have a Python version will show a deprecation warning and take some time to start. As soon the tag `latest` will point to Python 3.6 and the other tags will be removed.\n* There were several improvements in the base image `tiangolo\u002Fuwsgi-nginx` that improved this image too.\n* By default, now there is no limit in the upload file size in Nginx. It can be configured in an environment variable.\n* It's now possible to configure several things with environment variables:\n  * Serve `index.html` directly: `STATIC_INDEX`\n  * Set the max upload file size: `NGINX_MAX_UPLOAD`\n  * Set a custom `uwsgi.ini` file (that allows using a custom directory different than `\u002Fapp`): `UWSGI_INI` (using the ideas by @bercikr in #5 ).\n  * Set a custom `.\u002Fstatic\u002F` path: `STATIC_PATH`\n  * Set a custom `\u002Fstatic\u002F` URL: `STATIC_URL`\n* As all this configurations are available as environment variables, the choices are a lot more simple. Actually, any new project would just need to use a `Dockerfile` with:\n\n```Dockerfile\nFROM tiangolo\u002Fuwsgi-nginx-flask:python3.6\n\nCOPY .\u002Fapp \u002Fapp\n```\n\nand then customize with environment variables.\n\n## License\n\nThis project is licensed under the terms of the Apache license.\n","该项目提供了一个集成了uWSGI和Nginx的Docker镜像，用于在单个容器中运行Python Flask Web应用程序。它支持多种Python版本，并通过uWSGI和Nginx的组合来优化应用性能与稳定性。尽管项目已被官方标记为不再维护，但对于需要在一个容器内快速部署Flask应用的小型项目或测试环境来说，它仍是一个实用的选择。不过，对于使用Kubernetes等复杂容器编排工具的用户而言，建议直接构建自定义Docker镜像以满足更高级的需求。",2,"2026-06-11 03:30:38","top_topic"]