Skip to content

Commit

Permalink
✨ Add Python 3.9 and Python 3.9 Alpine (#67)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
  • Loading branch information
graue70 and tiangolo authored Sep 17, 2021
1 parent 11527c4 commit f3f9e07
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,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
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## Supported tags and respective `Dockerfile` links

* [`python3.8`, `latest` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.9`, `latest` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.9.dockerfile)
* [`python3.8`, _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.7`, _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.7.dockerfile)
* [`python3.6` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.6.dockerfile)
* [`python3.9-slim` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.9-slim.dockerfile)
* [`python3.8-slim` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.8-slim.dockerfile)
* [`python3.9-alpine3.14` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.9-alpine3.14.dockerfile)
* [`python3.8-alpine3.10` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.8-alpine3.10.dockerfile)
* [`python3.7-alpine3.8` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.7-alpine3.8.dockerfile)
* [`python3.6-alpine3.8` _(Dockerfile)_](/~https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/blob/master/docker-images/python3.6-alpine3.8.dockerfile)
Expand Down Expand Up @@ -91,7 +94,7 @@ If you are creating a new [**Starlette**](https://www.starlette.io/) web applica
* 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-fastapi:python3.7
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9

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

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

COPY ./app /app
```
Expand Down Expand Up @@ -209,7 +212,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-fastapi:python3.7
FROM tiangolo/uvicorn-gunicorn-fastapi: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
7 changes: 7 additions & 0 deletions docker-images/python3.9-alpine3.14.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM tiangolo/uvicorn-gunicorn:python3.9-alpine3.14

LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>"

RUN pip install --no-cache-dir fastapi

COPY ./app /app
7 changes: 7 additions & 0 deletions docker-images/python3.9-slim.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM tiangolo/uvicorn-gunicorn:python3.9-slim

LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>"

RUN pip install --no-cache-dir fastapi

COPY ./app /app
7 changes: 7 additions & 0 deletions docker-images/python3.9.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM tiangolo/uvicorn-gunicorn:python3.9

LABEL maintainer="Sebastian Ramirez <tiangolo@gmail.com>"

RUN pip install --no-cache-dir fastapi

COPY ./app /app
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-fastapi:$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 f3f9e07

Please sign in to comment.