From 4f7008a4cfb158be3b072551dc10a6145fb0bf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 9 May 2020 21:33:56 +0200 Subject: [PATCH 1/5] :fire: Remove deprecated versions --- docker-images/python2.7-alpine3.7.dockerfile | 35 -------------------- docker-images/python2.7-alpine3.8.dockerfile | 35 -------------------- docker-images/python3.6-alpine3.7.dockerfile | 35 -------------------- docker-images/python3.6-alpine3.8.dockerfile | 35 -------------------- 4 files changed, 140 deletions(-) delete mode 100644 docker-images/python2.7-alpine3.7.dockerfile delete mode 100644 docker-images/python2.7-alpine3.8.dockerfile delete mode 100644 docker-images/python3.6-alpine3.7.dockerfile delete mode 100644 docker-images/python3.6-alpine3.8.dockerfile diff --git a/docker-images/python2.7-alpine3.7.dockerfile b/docker-images/python2.7-alpine3.7.dockerfile deleted file mode 100644 index 4ea2bebd..00000000 --- a/docker-images/python2.7-alpine3.7.dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM tiangolo/uwsgi-nginx:python2.7-alpine3.7 - -LABEL maintainer="Sebastian Ramirez " - -RUN pip install flask - -# URL under which static (not modified by Python) files will be requested -# They will be served by Nginx directly, without being handled by uWSGI -ENV STATIC_URL /static -# Absolute path in where the static files wil be -ENV STATIC_PATH /app/static - -# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) -# ENV STATIC_INDEX 1 -ENV STATIC_INDEX 0 - -# Add demo app -COPY ./app /app -WORKDIR /app - -# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. -ENV PYTHONPATH=/app - -# Move the base entrypoint to reuse it -RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh -# Copy the entrypoint that will generate Nginx additional configs -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] - -# Run the start script provided by the parent image tiangolo/uwsgi-nginx. -# It will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Supervisor, which in turn will start Nginx and uWSGI -CMD ["/start.sh"] diff --git a/docker-images/python2.7-alpine3.8.dockerfile b/docker-images/python2.7-alpine3.8.dockerfile deleted file mode 100644 index bd73e2ff..00000000 --- a/docker-images/python2.7-alpine3.8.dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM tiangolo/uwsgi-nginx:python2.7-alpine3.8 - -LABEL maintainer="Sebastian Ramirez " - -RUN pip install flask - -# URL under which static (not modified by Python) files will be requested -# They will be served by Nginx directly, without being handled by uWSGI -ENV STATIC_URL /static -# Absolute path in where the static files wil be -ENV STATIC_PATH /app/static - -# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) -# ENV STATIC_INDEX 1 -ENV STATIC_INDEX 0 - -# Add demo app -COPY ./app /app -WORKDIR /app - -# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. -ENV PYTHONPATH=/app - -# Move the base entrypoint to reuse it -RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh -# Copy the entrypoint that will generate Nginx additional configs -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] - -# Run the start script provided by the parent image tiangolo/uwsgi-nginx. -# It will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Supervisor, which in turn will start Nginx and uWSGI -CMD ["/start.sh"] diff --git a/docker-images/python3.6-alpine3.7.dockerfile b/docker-images/python3.6-alpine3.7.dockerfile deleted file mode 100644 index e15cf22e..00000000 --- a/docker-images/python3.6-alpine3.7.dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM tiangolo/uwsgi-nginx:python3.6-alpine3.7 - -LABEL maintainer="Sebastian Ramirez " - -RUN pip install flask - -# URL under which static (not modified by Python) files will be requested -# They will be served by Nginx directly, without being handled by uWSGI -ENV STATIC_URL /static -# Absolute path in where the static files wil be -ENV STATIC_PATH /app/static - -# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) -# ENV STATIC_INDEX 1 -ENV STATIC_INDEX 0 - -# Add demo app -COPY ./app /app -WORKDIR /app - -# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. -ENV PYTHONPATH=/app - -# Move the base entrypoint to reuse it -RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh -# Copy the entrypoint that will generate Nginx additional configs -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] - -# Run the start script provided by the parent image tiangolo/uwsgi-nginx. -# It will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Supervisor, which in turn will start Nginx and uWSGI -CMD ["/start.sh"] diff --git a/docker-images/python3.6-alpine3.8.dockerfile b/docker-images/python3.6-alpine3.8.dockerfile deleted file mode 100644 index 2d155747..00000000 --- a/docker-images/python3.6-alpine3.8.dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM tiangolo/uwsgi-nginx:python3.6-alpine3.8 - -LABEL maintainer="Sebastian Ramirez " - -RUN pip install flask - -# URL under which static (not modified by Python) files will be requested -# They will be served by Nginx directly, without being handled by uWSGI -ENV STATIC_URL /static -# Absolute path in where the static files wil be -ENV STATIC_PATH /app/static - -# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) -# ENV STATIC_INDEX 1 -ENV STATIC_INDEX 0 - -# Add demo app -COPY ./app /app -WORKDIR /app - -# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. -ENV PYTHONPATH=/app - -# Move the base entrypoint to reuse it -RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh -# Copy the entrypoint that will generate Nginx additional configs -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] - -# Run the start script provided by the parent image tiangolo/uwsgi-nginx. -# It will check for an /app/prestart.sh script (e.g. for migrations) -# And then will start Supervisor, which in turn will start Nginx and uWSGI -CMD ["/start.sh"] From 7e22c6ab55816aff6705124efb80af1ff219cfb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 9 May 2020 21:34:14 +0200 Subject: [PATCH 2/5] :sparkles: Add Python 3.8 --- docker-images/python3.8.dockerfile | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docker-images/python3.8.dockerfile diff --git a/docker-images/python3.8.dockerfile b/docker-images/python3.8.dockerfile new file mode 100644 index 00000000..811ba1a8 --- /dev/null +++ b/docker-images/python3.8.dockerfile @@ -0,0 +1,35 @@ +FROM tiangolo/uwsgi-nginx:python3.8 + +LABEL maintainer="Sebastian Ramirez " + +RUN pip install flask + +# URL under which static (not modified by Python) files will be requested +# They will be served by Nginx directly, without being handled by uWSGI +ENV STATIC_URL /static +# Absolute path in where the static files wil be +ENV STATIC_PATH /app/static + +# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) +# ENV STATIC_INDEX 1 +ENV STATIC_INDEX 0 + +# Add demo app +COPY ./app /app +WORKDIR /app + +# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. +ENV PYTHONPATH=/app + +# Move the base entrypoint to reuse it +RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh +# Copy the entrypoint that will generate Nginx additional configs +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) +# And then will start Supervisor, which in turn will start Nginx and uWSGI +CMD ["/start.sh"] From 98fd383a2b71b99bf7f6eec350e824c127f75bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 9 May 2020 21:34:27 +0200 Subject: [PATCH 3/5] :sparkles: Add Python 3.8 with Alpine --- docker-images/python3.8-alpine.dockerfile | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docker-images/python3.8-alpine.dockerfile diff --git a/docker-images/python3.8-alpine.dockerfile b/docker-images/python3.8-alpine.dockerfile new file mode 100644 index 00000000..4061e3a7 --- /dev/null +++ b/docker-images/python3.8-alpine.dockerfile @@ -0,0 +1,35 @@ +FROM tiangolo/uwsgi-nginx:python3.8-alpine + +LABEL maintainer="Sebastian Ramirez " + +RUN pip install flask + +# URL under which static (not modified by Python) files will be requested +# They will be served by Nginx directly, without being handled by uWSGI +ENV STATIC_URL /static +# Absolute path in where the static files wil be +ENV STATIC_PATH /app/static + +# If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) +# ENV STATIC_INDEX 1 +ENV STATIC_INDEX 0 + +# Add demo app +COPY ./app /app +WORKDIR /app + +# Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations. +ENV PYTHONPATH=/app + +# Move the base entrypoint to reuse it +RUN mv /entrypoint.sh /uwsgi-nginx-entrypoint.sh +# Copy the entrypoint that will generate Nginx additional configs +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + +# Run the start script provided by the parent image tiangolo/uwsgi-nginx. +# It will check for an /app/prestart.sh script (e.g. for migrations) +# And then will start Supervisor, which in turn will start Nginx and uWSGI +CMD ["/start.sh"] From 3bc33dd56ed8e60adb916bf81eee3f9c03127b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 9 May 2020 21:34:51 +0200 Subject: [PATCH 4/5] :construction_worker: Update CI with Python 3.8 --- .github/workflows/deploy.yml | 14 +++++--------- .github/workflows/test.yml | 14 +++++--------- scripts/build.sh | 2 +- scripts/process_all.py | 8 +++----- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cf7516c4..9031325a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,21 +11,17 @@ jobs: matrix: image: - name: latest - python_version: "3.7" + python_version: "3.8" + - name: python3.8 + python_version: "3.8" - name: python3.7 python_version: "3.7" - name: python3.6 python_version: "3.6" - name: python2.7 python_version: "2.7" - - name: python3.6-alpine3.8 - python_version: "3.6" - - name: python3.6-alpine3.7 - python_version: "3.6" - - name: python2.7-alpine3.8 - python_version: "2.7" - - name: python2.7-alpine3.7 - python_version: "2.7" + - name: python3.8-alpine + python_version: "3.8" fail-fast: true runs-on: ubuntu-18.04 steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a78d8b04..5618b341 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,21 +11,17 @@ jobs: matrix: image: - name: latest - python_version: "3.7" + python_version: "3.8" + - name: python3.8 + python_version: "3.8" - name: python3.7 python_version: "3.7" - name: python3.6 python_version: "3.6" - name: python2.7 python_version: "2.7" - - name: python3.6-alpine3.8 - python_version: "3.6" - - name: python3.6-alpine3.7 - python_version: "3.6" - - name: python2.7-alpine3.8 - python_version: "2.7" - - name: python2.7-alpine3.7 - python_version: "2.7" + - name: python3.8-alpine + python_version: "3.8" fail-fast: true runs-on: ubuntu-18.04 steps: diff --git a/scripts/build.sh b/scripts/build.sh index 06368593..57cd7b51 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -6,7 +6,7 @@ use_tag="tiangolo/uwsgi-nginx-flask:$NAME" DOCKERFILE="$NAME" if [ "$NAME" == "latest" ] ; then - DOCKERFILE="python3.7" + DOCKERFILE="python3.8" fi docker build -t "$use_tag" --file "./docker-images/${DOCKERFILE}.dockerfile" "./docker-images/" diff --git a/scripts/process_all.py b/scripts/process_all.py index edb504ce..4f1895b8 100644 --- a/scripts/process_all.py +++ b/scripts/process_all.py @@ -3,14 +3,12 @@ import sys environments = [ - {"NAME": "latest", "PYTHON_VERSION": "3.7"}, + {"NAME": "latest", "PYTHON_VERSION": "3.8"}, + {"NAME": "python3.8", "PYTHON_VERSION": "3.8"}, {"NAME": "python3.7", "PYTHON_VERSION": "3.7"}, {"NAME": "python3.6", "PYTHON_VERSION": "3.6"}, {"NAME": "python2.7", "PYTHON_VERSION": "2.7"}, - {"NAME": "python3.6-alpine3.8", "PYTHON_VERSION": "3.6"}, - {"NAME": "python3.6-alpine3.7", "PYTHON_VERSION": "3.6"}, - {"NAME": "python2.7-alpine3.8", "PYTHON_VERSION": "2.7"}, - {"NAME": "python2.7-alpine3.7", "PYTHON_VERSION": "2.7"}, + {"NAME": "python3.8-alpine", "PYTHON_VERSION": "3.8"}, ] start_with = os.environ.get("START_WITH") From 658520f96707f12c1b76287373280a017bde6e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 9 May 2020 21:39:03 +0200 Subject: [PATCH 5/5] :truck: Update references from Python 3.7 to Python 3.8 --- README.md | 47 ++++++++----------- example-flask-package-python3.7/Dockerfile | 3 -- example-flask-package-python3.8/Dockerfile | 3 ++ .../app/app/__init__.py | 0 .../app/app/api/__init__.py | 0 .../app/app/api/api.py | 0 .../app/app/api/endpoints/__init__.py | 0 .../app/app/api/endpoints/user.py | 0 .../app/app/api/utils.py | 0 .../app/app/core/__init__.py | 0 .../app/app/core/app_setup.py | 0 .../app/app/core/database.py | 0 .../app/app/main.py | 0 .../app/app/models/__init__.py | 0 .../app/app/models/user.py | 0 .../app/uwsgi.ini | 0 .../docker-compose.override.yml | 0 .../docker-compose.yml | 0 example-flask-python3.7/Dockerfile | 3 -- .../Dockerfile | 2 +- .../app/main.py | 0 .../app/static/index.html | 0 .../app/uwsgi.ini | 0 .../docker-compose.override.yml | 0 .../docker-compose.yml | 0 example-flask-python3.8/Dockerfile | 3 ++ .../app/main.py | 0 .../app/uwsgi.ini | 0 .../docker-compose.override.yml | 0 .../docker-compose.yml | 0 30 files changed, 27 insertions(+), 34 deletions(-) delete mode 100644 example-flask-package-python3.7/Dockerfile create mode 100644 example-flask-package-python3.8/Dockerfile rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/__init__.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/api/__init__.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/api/api.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/api/endpoints/__init__.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/api/endpoints/user.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/api/utils.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/core/__init__.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/core/app_setup.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/core/database.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/main.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/models/__init__.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/app/models/user.py (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/app/uwsgi.ini (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/docker-compose.override.yml (100%) rename {example-flask-package-python3.7 => example-flask-package-python3.8}/docker-compose.yml (100%) delete mode 100644 example-flask-python3.7/Dockerfile rename {example-flask-python3.7-index => example-flask-python3.8-index}/Dockerfile (75%) rename {example-flask-python3.7-index => example-flask-python3.8-index}/app/main.py (100%) rename {example-flask-python3.7-index => example-flask-python3.8-index}/app/static/index.html (100%) rename {example-flask-python3.7-index => example-flask-python3.8-index}/app/uwsgi.ini (100%) rename {example-flask-python3.7-index => example-flask-python3.8-index}/docker-compose.override.yml (100%) rename {example-flask-python3.7-index => example-flask-python3.8-index}/docker-compose.yml (100%) create mode 100644 example-flask-python3.8/Dockerfile rename {example-flask-python3.7 => example-flask-python3.8}/app/main.py (100%) rename {example-flask-python3.7 => example-flask-python3.8}/app/uwsgi.ini (100%) rename {example-flask-python3.7 => example-flask-python3.8}/docker-compose.override.yml (100%) rename {example-flask-python3.7 => example-flask-python3.8}/docker-compose.yml (100%) diff --git a/README.md b/README.md index b7081e93..2359d4b5 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,14 @@ ## Supported tags and respective `Dockerfile` links -* [`python3.7`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.7.dockerfile) +* [`python3.8`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.8.dockerfile) +* [`python3.8-alpine` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.8-alpine.dockerfile) +* [`python3.7`, _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.7.dockerfile) * [`python3.6` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6.dockerfile) -* [`python3.6-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6-alpine3.8.dockerfile) -* [`python3.6-alpine3.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python3.6-alpine3.7.dockerfile) * [`python2.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7.dockerfile) -* [`python2.7-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7-alpine3.8.dockerfile) -* [`python2.7-alpine3.7` _(Dockerfile)_](https://github.com/tiangolo/uwsgi-nginx-flask-docker/blob/master/docker-images/python2.7-alpine3.7.dockerfile) **Note**: Note: There are [tags for each build date](https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/tags). If you need to "pin" the Docker image version you use, you can select one of those tags. E.g. `tiangolo/uwsgi-nginx-flask:python3.7-2019-10-14`. -## Python 3.7 not supported in in Alpine - -As uWSGI has not been released with Python 3.7 support for [Alpine 3.7](https://pkgs.alpinelinux.org/package/v3.7/main/x86/uwsgi-python3) and [Alpine 3.8](https://pkgs.alpinelinux.org/package/v3.8/main/x86/uwsgi-python3), it is still not supported. - -It doesn't depend on this image but on uWSGI releases for Alpine. - # uwsgi-nginx-flask **Docker** image with **uWSGI** and **Nginx** for **Flask** web applications in **Python 3.6** and above, and **Python 2.7** running in a single container. Optionally using Alpine Linux. @@ -59,24 +51,24 @@ It is very similar to **tiangolo/uwsgi-nginx-flask**, so you can still use many ## Examples (simple project templates) -* **`python3.7`** tag: general Flask web application: +* **`python3.8`** tag: general Flask web application: -[**example-flask-python3.7.zip**]() +[**example-flask-python3.8.zip**]() -* **`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.8`** 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: -[**example-flask-package-python3.7.zip**]() +[**example-flask-package-python3.8.zip**]() -* **`python3.7`** tag: `static/index.html` served directly in `/`, e.g. for [Vue](https://vuejs.org/), [React](https://reactjs.org/), [Angular](https://angular.io/), or any other Single-Page Application that uses a static `index.html`, not modified by Python: +* **`python3.8`** tag: `static/index.html` served directly in `/`, e.g. for [Vue](https://vuejs.org/), [React](https://reactjs.org/), [Angular](https://angular.io/), or any other Single-Page Application that uses a static `index.html`, not modified by Python: -[**example-flask-python3.7-index.zip**]() +[**example-flask-python3.8-index.zip**]() ## General Instructions 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: ```Dockerfile -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 COPY ./app /app ``` @@ -91,7 +83,7 @@ This Docker image is based on [**tiangolo/uwsgi-nginx**](https://hub.docker.com/ ## Quick Start -**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. +**Note**: You can download the **example-flask-python3.8.zip** project example and use it as the template for your project from the section **Examples** above. --- @@ -101,7 +93,7 @@ Or you may follow the instructions to build your project from scratch: * Create a `Dockerfile` with: ```Dockerfile -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 COPY ./app /app ``` @@ -278,7 +270,7 @@ If you want to check the previous (deprecated) documentation on adding a fronten ## Quick Start for bigger projects structured as a Python package -**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. +**Note**: You can download the **example-flask-package-python3.8.zip** project example and use it as an example or template for your project from the section **Examples** above. --- @@ -416,7 +408,7 @@ Have in mind that `UWSGI_CHEAPER` must be lower than `UWSGI_PROCESSES`. So, if, for example, you need to start with 4 processes and grow to a maximum of 64, your `Dockerfile` could look like: ```Dockerfile -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 ENV UWSGI_CHEAPER 4 ENV UWSGI_PROCESSES 64 @@ -443,7 +435,7 @@ To change this behavior, set the `LISTEN_PORT` environment variable. You might a You can do that in your `Dockerfile`, it would look something like: ```Dockerfile -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 ENV LISTEN_PORT 8080 @@ -580,7 +572,7 @@ or you can set it to the keyword `auto` and it will try to auto-detect the numbe For example, using `auto`, your Dockerfile could look like: ```Dockerfile -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 ENV NGINX_WORKER_PROCESSES auto @@ -761,7 +753,7 @@ if __name__ == "__main__": ...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. -**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. +**Note**: The example project **example-flask-python3.8** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose. --- @@ -803,7 +795,7 @@ def route_frontend(path): That's how it is written in the tutorial above and is included in the downloadable examples. -**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. +**Note**: The example project **example-flask-python3.8-index** includes a `docker-compose.yml` and `docker-compose.override.yml` with all these configurations, if you are using Docker Compose. ## More advanced development instructions @@ -861,6 +853,7 @@ You will see your Flask debugging server start, you will see how it sends respon * Debian Stretch (before upgrading to Buster). * Python 3.5. * Alpine 3.7 and 3.8 (before upgrading to Alpine 3.11). + * Alpine in older versions of Python, 2.7 and 3.6 (Before upgrading to Python 3.8). * Tags with `-index` (use `ENV STATIC_INDEX 1` instead). * If you need any of those, make sure to use a tag for the build date `2020-05-04`. @@ -871,7 +864,7 @@ You will see your Flask debugging server start, you will see how it sends respon ### 1.2.0 -* Refactor tests to use env vars and add image tags for each build date, like `tiangolo/uwsgi-nginx-flask:python3.7-2019-10-14`. PR [#154](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/154). +* Refactor tests to use env vars and add image tags for each build date, like `tiangolo/uwsgi-nginx-flask:python3.8-2019-10-14`. PR [#154](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/154). * Upgrade Travis. PR [#135](https://github.com/tiangolo/uwsgi-nginx-flask-docker/pull/135). ### 1.1.0 diff --git a/example-flask-package-python3.7/Dockerfile b/example-flask-package-python3.7/Dockerfile deleted file mode 100644 index 4fe5a964..00000000 --- a/example-flask-package-python3.7/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM tiangolo/uwsgi-nginx-flask:python3.7 - -COPY ./app /app diff --git a/example-flask-package-python3.8/Dockerfile b/example-flask-package-python3.8/Dockerfile new file mode 100644 index 00000000..960c7e24 --- /dev/null +++ b/example-flask-package-python3.8/Dockerfile @@ -0,0 +1,3 @@ +FROM tiangolo/uwsgi-nginx-flask:python3.8 + +COPY ./app /app diff --git a/example-flask-package-python3.7/app/app/__init__.py b/example-flask-package-python3.8/app/app/__init__.py similarity index 100% rename from example-flask-package-python3.7/app/app/__init__.py rename to example-flask-package-python3.8/app/app/__init__.py diff --git a/example-flask-package-python3.7/app/app/api/__init__.py b/example-flask-package-python3.8/app/app/api/__init__.py similarity index 100% rename from example-flask-package-python3.7/app/app/api/__init__.py rename to example-flask-package-python3.8/app/app/api/__init__.py diff --git a/example-flask-package-python3.7/app/app/api/api.py b/example-flask-package-python3.8/app/app/api/api.py similarity index 100% rename from example-flask-package-python3.7/app/app/api/api.py rename to example-flask-package-python3.8/app/app/api/api.py diff --git a/example-flask-package-python3.7/app/app/api/endpoints/__init__.py b/example-flask-package-python3.8/app/app/api/endpoints/__init__.py similarity index 100% rename from example-flask-package-python3.7/app/app/api/endpoints/__init__.py rename to example-flask-package-python3.8/app/app/api/endpoints/__init__.py diff --git a/example-flask-package-python3.7/app/app/api/endpoints/user.py b/example-flask-package-python3.8/app/app/api/endpoints/user.py similarity index 100% rename from example-flask-package-python3.7/app/app/api/endpoints/user.py rename to example-flask-package-python3.8/app/app/api/endpoints/user.py diff --git a/example-flask-package-python3.7/app/app/api/utils.py b/example-flask-package-python3.8/app/app/api/utils.py similarity index 100% rename from example-flask-package-python3.7/app/app/api/utils.py rename to example-flask-package-python3.8/app/app/api/utils.py diff --git a/example-flask-package-python3.7/app/app/core/__init__.py b/example-flask-package-python3.8/app/app/core/__init__.py similarity index 100% rename from example-flask-package-python3.7/app/app/core/__init__.py rename to example-flask-package-python3.8/app/app/core/__init__.py diff --git a/example-flask-package-python3.7/app/app/core/app_setup.py b/example-flask-package-python3.8/app/app/core/app_setup.py similarity index 100% rename from example-flask-package-python3.7/app/app/core/app_setup.py rename to example-flask-package-python3.8/app/app/core/app_setup.py diff --git a/example-flask-package-python3.7/app/app/core/database.py b/example-flask-package-python3.8/app/app/core/database.py similarity index 100% rename from example-flask-package-python3.7/app/app/core/database.py rename to example-flask-package-python3.8/app/app/core/database.py diff --git a/example-flask-package-python3.7/app/app/main.py b/example-flask-package-python3.8/app/app/main.py similarity index 100% rename from example-flask-package-python3.7/app/app/main.py rename to example-flask-package-python3.8/app/app/main.py diff --git a/example-flask-package-python3.7/app/app/models/__init__.py b/example-flask-package-python3.8/app/app/models/__init__.py similarity index 100% rename from example-flask-package-python3.7/app/app/models/__init__.py rename to example-flask-package-python3.8/app/app/models/__init__.py diff --git a/example-flask-package-python3.7/app/app/models/user.py b/example-flask-package-python3.8/app/app/models/user.py similarity index 100% rename from example-flask-package-python3.7/app/app/models/user.py rename to example-flask-package-python3.8/app/app/models/user.py diff --git a/example-flask-package-python3.7/app/uwsgi.ini b/example-flask-package-python3.8/app/uwsgi.ini similarity index 100% rename from example-flask-package-python3.7/app/uwsgi.ini rename to example-flask-package-python3.8/app/uwsgi.ini diff --git a/example-flask-package-python3.7/docker-compose.override.yml b/example-flask-package-python3.8/docker-compose.override.yml similarity index 100% rename from example-flask-package-python3.7/docker-compose.override.yml rename to example-flask-package-python3.8/docker-compose.override.yml diff --git a/example-flask-package-python3.7/docker-compose.yml b/example-flask-package-python3.8/docker-compose.yml similarity index 100% rename from example-flask-package-python3.7/docker-compose.yml rename to example-flask-package-python3.8/docker-compose.yml diff --git a/example-flask-python3.7/Dockerfile b/example-flask-python3.7/Dockerfile deleted file mode 100644 index 4fe5a964..00000000 --- a/example-flask-python3.7/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM tiangolo/uwsgi-nginx-flask:python3.7 - -COPY ./app /app diff --git a/example-flask-python3.7-index/Dockerfile b/example-flask-python3.8-index/Dockerfile similarity index 75% rename from example-flask-python3.7-index/Dockerfile rename to example-flask-python3.8-index/Dockerfile index 3655445f..d0638a42 100644 --- a/example-flask-python3.7-index/Dockerfile +++ b/example-flask-python3.8-index/Dockerfile @@ -1,4 +1,4 @@ -FROM tiangolo/uwsgi-nginx-flask:python3.7 +FROM tiangolo/uwsgi-nginx-flask:python3.8 # If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured) ENV STATIC_INDEX 1 diff --git a/example-flask-python3.7-index/app/main.py b/example-flask-python3.8-index/app/main.py similarity index 100% rename from example-flask-python3.7-index/app/main.py rename to example-flask-python3.8-index/app/main.py diff --git a/example-flask-python3.7-index/app/static/index.html b/example-flask-python3.8-index/app/static/index.html similarity index 100% rename from example-flask-python3.7-index/app/static/index.html rename to example-flask-python3.8-index/app/static/index.html diff --git a/example-flask-python3.7-index/app/uwsgi.ini b/example-flask-python3.8-index/app/uwsgi.ini similarity index 100% rename from example-flask-python3.7-index/app/uwsgi.ini rename to example-flask-python3.8-index/app/uwsgi.ini diff --git a/example-flask-python3.7-index/docker-compose.override.yml b/example-flask-python3.8-index/docker-compose.override.yml similarity index 100% rename from example-flask-python3.7-index/docker-compose.override.yml rename to example-flask-python3.8-index/docker-compose.override.yml diff --git a/example-flask-python3.7-index/docker-compose.yml b/example-flask-python3.8-index/docker-compose.yml similarity index 100% rename from example-flask-python3.7-index/docker-compose.yml rename to example-flask-python3.8-index/docker-compose.yml diff --git a/example-flask-python3.8/Dockerfile b/example-flask-python3.8/Dockerfile new file mode 100644 index 00000000..960c7e24 --- /dev/null +++ b/example-flask-python3.8/Dockerfile @@ -0,0 +1,3 @@ +FROM tiangolo/uwsgi-nginx-flask:python3.8 + +COPY ./app /app diff --git a/example-flask-python3.7/app/main.py b/example-flask-python3.8/app/main.py similarity index 100% rename from example-flask-python3.7/app/main.py rename to example-flask-python3.8/app/main.py diff --git a/example-flask-python3.7/app/uwsgi.ini b/example-flask-python3.8/app/uwsgi.ini similarity index 100% rename from example-flask-python3.7/app/uwsgi.ini rename to example-flask-python3.8/app/uwsgi.ini diff --git a/example-flask-python3.7/docker-compose.override.yml b/example-flask-python3.8/docker-compose.override.yml similarity index 100% rename from example-flask-python3.7/docker-compose.override.yml rename to example-flask-python3.8/docker-compose.override.yml diff --git a/example-flask-python3.7/docker-compose.yml b/example-flask-python3.8/docker-compose.yml similarity index 100% rename from example-flask-python3.7/docker-compose.yml rename to example-flask-python3.8/docker-compose.yml