You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python 3.6**, **Python 3.5** and **Python 2.7** running in a single container. Optionally using Alpine Linux.
26
+
**Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python 3.7**, **Python 3.6**, **Python 3.5** and **Python 2.7** running in a single container. Optionally using Alpine Linux.
25
27
26
28
## Description
27
29
@@ -37,29 +39,29 @@ There is also an Alpine version. If you want it, use one of the Alpine tags from
37
39
38
40
## Examples (project templates)
39
41
40
-
***`python3.6`** tag: general Flask web application:
42
+
***`python3.7`** tag: general Flask web application:
***`python3.6`** tag: general Flask web application, structured as a package, for bigger Flask projects, with different submodules. Use it only as an example of how to import your modules and how to structure your own project:
46
+
***`python3.7`** tag: general Flask web application, structured as a package, for bigger Flask projects, with different submodules. Use it only as an example of how to import your modules and how to structure your own project:
***`python3.6-index`** tag: `static/index.html` served directly in `/`, e.g. for Angular, React, or any other Single-Page Application that uses a static `index.html`, not modified by Python:
50
+
***`python3.7`** tag: `static/index.html` served directly in `/`, e.g. for Angular, React, or any other Single-Page Application that uses a static `index.html`, not modified by Python:
You don't have to clone this repo, you should be able to use this image as a base image for your project with something in your `Dockerfile` like:
55
57
56
58
```Dockerfile
57
-
FROM tiangolo/uwsgi-nginx-flask:python3.6
59
+
FROM tiangolo/uwsgi-nginx-flask:python3.7
58
60
59
61
COPY ./app /app
60
62
```
61
63
62
-
There are several image tags available for Python 3.6, Python 3.5 and Python 2.7, but for new projects you should use **Python 3.6**.
64
+
There are several image tags available for Python 3.7, Python 3.6, Python 3.5 and Python 2.7, but for new projects you should use **Python 3.7**.
63
65
64
66
As of now, [everyone](https://www.python.org/dev/peps/pep-0373/)[should be](http://flask.pocoo.org/docs/0.12/python3/#python3-support)[using **Python 3**](https://docs.djangoproject.com/en/1.11/faq/install/#what-python-version-should-i-use-with-django).
65
67
@@ -70,7 +72,7 @@ This Docker image is based on [**tiangolo/uwsgi-nginx**](https://hub.docker.com/
70
72
71
73
## QuickStart
72
74
73
-
**Note**: You can download the **example-flask-python3.6.zip** project example and use it as the template for your project from the section **Examples** above.
75
+
**Note**: You can download the **example-flask-python3.7.zip** project example and use it as the template for your project from the section **Examples** above.
74
76
75
77
---
76
78
@@ -80,7 +82,7 @@ Or you may follow the instructions to build your project from scratch:
80
82
* Create a `Dockerfile` with:
81
83
82
84
```Dockerfile
83
-
FROM tiangolo/uwsgi-nginx-flask:python3.6
85
+
FROM tiangolo/uwsgi-nginx-flask:python3.7
84
86
85
87
COPY ./app /app
86
88
```
@@ -138,7 +140,7 @@ This section explains how to configure the image to serve the contents of `/stat
138
140
139
141
This is specially helpful (and efficient) if you are building a Single-Page Application (SPA) with JavaScript (Angular, React, etc) and you want the `index.html` to be served directly, without modifications by Python or Jinja2 templates. And you want to use Flask mainly as an API / back end for your SPA front end.
140
142
141
-
**Note**: You can download the example project **example-flask-python3.6-index.zip** and use it as the template for your project in the **Examples** section above.
143
+
**Note**: You can download the example project **example-flask-python3.7-index.zip** and use it as the template for your project in the **Examples** section above.
142
144
143
145
---
144
146
@@ -148,7 +150,7 @@ Or you may follow the instructions to build your project from scratch (it's very
## QuickStart for bigger projects structured as a Python package
248
250
249
-
**Note**: You can download the **example-flask-package-python3.6.zip** project example and use it as an example or template for your project from the section **Examples** above.
251
+
**Note**: You can download the **example-flask-package-python3.7.zip** project example and use it as an example or template for your project from the section **Examples** above.
250
252
251
253
---
252
254
@@ -381,7 +383,7 @@ To change this behavior, set the `LISTEN_PORT` environment variable. You might a
381
383
You can do that in your `Dockerfile`, it would look something like:
382
384
383
385
```Dockerfile
384
-
FROM tiangolo/uwsgi-nginx-flask:python3.6
386
+
FROM tiangolo/uwsgi-nginx-flask:python3.7
385
387
386
388
ENV LISTEN_PORT 8080
387
389
@@ -492,7 +494,7 @@ or you can set it to the keyword `auto` and it will try to autodetect the number
492
494
For example, using `auto`, your Dockerfile could look like:
493
495
494
496
```Dockerfile
495
-
FROM tiangolo/uwsgi-nginx-flask:python3.6
497
+
FROM tiangolo/uwsgi-nginx-flask:python3.7
496
498
497
499
ENV NGINX_WORKER_PROCESSES auto
498
500
@@ -653,7 +655,7 @@ if __name__ == "__main__":
653
655
654
656
...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.
655
657
656
-
**Note**: The example project **example-flask-python3.6** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose.
658
+
**Note**: The example project **example-flask-python3.7** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose.
657
659
658
660
---
659
661
@@ -695,7 +697,7 @@ def route_frontend(path):
695
697
696
698
That's how it is written in the tutorial above and is included in the downloadable examples.
697
699
698
-
**Note**: The example project **example-flask-python3.6-index** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose.
700
+
**Note**: The example project **example-flask-python3.7-index** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose.
699
701
700
702
## More advanced development instructions
701
703
@@ -737,6 +739,10 @@ You will see your Flask debugging server start, you will see how it sends respon
737
739
738
740
## What's new
739
741
742
+
2018-09-22:
743
+
744
+
* 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://github.com/desaintmartin) in [this PR](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/82).
745
+
740
746
2018-06-22:
741
747
742
748
* 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://github.com/ronlut) in [this PR](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/56).
0 commit comments