Skip to content

Commit

Permalink
✨ Add support for Python 3.8 (#15)
Browse files Browse the repository at this point in the history
* ✨ Add support for Python 3.8

* 📝 Update README
  • Loading branch information
tiangolo authored May 4, 2020
1 parent 037d96d commit 414a70b
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ 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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ 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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Supported tags and respective `Dockerfile` links

* [`python3.7`, `latest` _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.7.dockerfile)
* [`python3.8`, `latest` _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.8.dockerfile)
* [`python3.7`, _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.7.dockerfile)
* [`python3.6` _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.6.dockerfile)
* [`python2.7` _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python2.7.dockerfile)
* [`python3.6-alpine3.8` _(Dockerfile)_](https://github.com/tiangolo/meinheld-gunicorn-docker/blob/master/docker-images/python3.6-alpine3.8.dockerfile)
Expand Down
26 changes: 26 additions & 0 deletions docker-images/python3.8.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.8

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

RUN pip install meinheld gunicorn

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

COPY ./start.sh /start.sh
RUN chmod +x /start.sh

COPY ./gunicorn_conf.py /gunicorn_conf.py

COPY ./app /app
WORKDIR /app/

ENV PYTHONPATH=/app

EXPOSE 80

ENTRYPOINT ["/entrypoint.sh"]

# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
# And then will start Gunicorn with Meinheld
CMD ["/start.sh"]
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/meinheld-gunicorn:$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/"
9 changes: 5 additions & 4 deletions scripts/process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
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"},
Expand All @@ -15,7 +16,7 @@
build_push = os.environ.get("BUILD_PUSH")


def process_tag(*, env: dict):
def process_tag(*, env: dict) -> None:
use_env = {**os.environ, **env}
script = "scripts/test.sh"
if build_push:
Expand All @@ -25,7 +26,7 @@ def process_tag(*, env: dict):
sys.exit(return_code)


def print_version_envs():
def print_version_envs() -> None:
env_lines = []
for env in environments:
env_vars = []
Expand All @@ -36,7 +37,7 @@ def print_version_envs():
print(line)


def main():
def main() -> None:
start_at = 0
if start_with:
start_at = [
Expand Down

0 comments on commit 414a70b

Please sign in to comment.