Skip to content

Commit

Permalink
👷 Add support for Python 3.9 and Python 3.9 Alpine (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Sep 17, 2021
1 parent 1aa1961 commit 7949548
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ jobs:
matrix:
image:
- name: latest
python_version: "3.8"
python_version: "3.9"
- name: python3.8
python_version: "3.8"
- name: python3.9
python_version: "3.9"
- name: python3.7
python_version: "3.7"
- name: python3.6
python_version: "3.6"
- name: python3.9-slim
python_version: "3.9"
- name: python3.8-slim
python_version: "3.8"
- name: python3.9-alpine3.14
python_version: "3.9"
- name: python3.8-alpine3.10
python_version: "3.8"
- name: python3.7-alpine3.8
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ jobs:
matrix:
image:
- name: latest
python_version: "3.8"
python_version: "3.9"
- name: python3.9
python_version: "3.9"
- name: python3.8
python_version: "3.8"
- name: python3.7
python_version: "3.7"
- name: python3.6
python_version: "3.6"
- name: python3.9-slim
python_version: "3.9"
- name: python3.8-slim
python_version: "3.8"
- name: python3.9-alpine3.14
python_version: "3.9"
- name: python3.8-alpine3.10
python_version: "3.8"
- name: python3.7-alpine3.8
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

## Supported tags and respective `Dockerfile` links

* [`python3.8`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.9`, `latest` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.9.dockerfile)
* [`python3.8`, _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.7`, _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.7.dockerfile)
* [`python3.6` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.6.dockerfile)
* [`python3.8-slim` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8-slim.dockerfile)
* [`python3.8-alpine3.10` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8-alpine3.10.dockerfile)
* [`python3.8-slim` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.9-slim.dockerfile)
* [`python3.9-slim` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8-slim.dockerfile)
* [`python3.8-alpine3.10` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.9-alpine3.14.dockerfile)
* [`python3.9-alpine3.14` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.8-alpine3.10.dockerfile)
* [`python3.7-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.7-alpine3.8.dockerfile)
* [`python3.6-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/uvicorn-gunicorn-starlette-docker/blob/master/docker-images/python3.6-alpine3.8.dockerfile)

Expand Down Expand Up @@ -77,7 +80,7 @@ If you are creating a new [**FastAPI**](https://fastapi.tiangolo.com/) web appli
* You don't need to clone the GitHub repo. You can use this image as a base image for other images, using this in your `Dockerfile`:

```Dockerfile
FROM tiangolo/uvicorn-gunicorn-starlette:python3.7
FROM tiangolo/uvicorn-gunicorn-starlette:python3.9

COPY ./app /app
```
Expand All @@ -100,7 +103,7 @@ docker build -t myimage ./
* Create a `Dockerfile` with:

```Dockerfile
FROM tiangolo/uvicorn-gunicorn-starlette:python3.7
FROM tiangolo/uvicorn-gunicorn-starlette:python3.9

COPY ./app /app
```
Expand Down Expand Up @@ -171,7 +174,7 @@ Let's say you have a project managed with [Poetry](https://python-poetry.org/),
Then you could have a `Dockerfile` like:

```Dockerfile
FROM tiangolo/uvicorn-gunicorn-starlette:python3.7
FROM tiangolo/uvicorn-gunicorn-starlette:python3.9

# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use_tag="tiangolo/uvicorn-gunicorn-starlette:$NAME"
DOCKERFILE="$NAME"

if [ "$NAME" == "latest" ] ; then
DOCKERFILE="python3.8"
DOCKERFILE="python3.9"
fi

docker build -t "$use_tag" --file "./docker-images/${DOCKERFILE}.dockerfile" "./docker-images/"
5 changes: 4 additions & 1 deletion scripts/process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import sys

environments = [
{"NAME": "latest", "PYTHON_VERSION": "3.8"},
{"NAME": "latest", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.9", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.8", "PYTHON_VERSION": "3.8"},
{"NAME": "python3.7", "PYTHON_VERSION": "3.7"},
{"NAME": "python3.6", "PYTHON_VERSION": "3.6"},
{"NAME": "python3.9-slim", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.8-slim", "PYTHON_VERSION": "3.8"},
{"NAME": "python3.9-alpine3.14", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.8-alpine3.10", "PYTHON_VERSION": "3.8"},
{"NAME": "python3.7-alpine3.8", "PYTHON_VERSION": "3.7"},
{"NAME": "python3.6-alpine3.8", "PYTHON_VERSION": "3.6"},
Expand Down

0 comments on commit 7949548

Please sign in to comment.