Skip to content

Commit

Permalink
add support for python3.8.16-slim
Browse files Browse the repository at this point in the history
  • Loading branch information
lvitti committed May 29, 2024
1 parent 969fbce commit 2ce8b73
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 12 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
python_version: "3.9"
- name: python3.8-slim
python_version: "3.8"
- name: python3.8.16-slim
python_version: "3.8.16"
fail-fast: true
runs-on: ubuntu-latest
steps:
Expand All @@ -58,13 +60,13 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
tiangolo/uvicorn-gunicorn:${{ matrix.image.name }}
tiangolo/uvicorn-gunicorn:${{ matrix.image.name }}-${{ env.DATE_TAG }}
shiphero/uvicorn-gunicorn:${{ matrix.image.name }}
shiphero/uvicorn-gunicorn:${{ matrix.image.name }}-${{ env.DATE_TAG }}
context: ./docker-images/
file: ./docker-images/${{ env.DOCKERFILE_NAME }}.dockerfile
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: tiangolo/uvicorn-gunicorn
repository: shiphero/uvicorn-gunicorn
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
python_version: "3.9"
- name: python3.8-slim
python_version: "3.8"
- name: python3.8.16-slim
python_version: "3.8.16"
fail-fast: true
runs-on: ubuntu-latest
steps:
Expand All @@ -51,7 +53,7 @@ jobs:
uses: docker/build-push-action@v5
with:
push: false
tags: tiangolo/uvicorn-gunicorn:${{ matrix.image.name }}
tags: shiphero/uvicorn-gunicorn:${{ matrix.image.name }}
context: ./docker-images/
file: ./docker-images/${{ env.DOCKERFILE_NAME }}.dockerfile
- name: Set up Python
Expand Down
28 changes: 28 additions & 0 deletions docker-images/python3.8.16-slim.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.8.16-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

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

COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt

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

COPY ./gunicorn_conf.py /gunicorn_conf.py

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

COPY ./app /app
WORKDIR /app/

ENV PYTHONPATH=/app

EXPOSE 80

# Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
# And then will start Gunicorn with Uvicorn
CMD ["/start.sh"]
1 change: 1 addition & 0 deletions scripts/process_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
{"NAME": "python3.10-slim", "PYTHON_VERSION": "3.10"},
{"NAME": "python3.9-slim", "PYTHON_VERSION": "3.9"},
{"NAME": "python3.8-slim", "PYTHON_VERSION": "3.8"},
{"NAME": "python3.8.16-slim", "PYTHON_VERSION": "3.8.16"},
]

start_with = os.environ.get("START_WITH")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_01_main/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def verify_container(container: Container, response_text: str) -> None:

def test_defaults() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
response_text = get_response_text1()
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_01_main/test_env_vars_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def verify_container(container: DockerClient, response_text: str) -> None:

def test_env_vars_1() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
response_text = get_response_text1()
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_01_main/test_env_vars_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def verify_container(container: Container) -> None:

def test_env_vars_2() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
container = client.containers.run(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_01_main/test_env_vars_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def verify_container(container: DockerClient, response_text: str) -> None:

def test_env_bind() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
response_text = get_response_text1()
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_03_reload/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def verify_container(container: DockerClient, response_text: str) -> None:

def test_defaults() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
response_text = get_response_text1()
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_03_reload/test_env_vars_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def verify_container(container: DockerClient, response_text: str) -> None:

def test_env_vars_1() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
response_text = get_response_text1()
sleep_time = int(os.getenv("SLEEP_TIME", 1))
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_03_reload/test_env_vars_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def verify_container(container: Container) -> None:

def test_env_vars_2() -> None:
name = os.getenv("NAME")
image = f"tiangolo/uvicorn-gunicorn:{name}"
image = f"shiphero/uvicorn-gunicorn:{name}"
sleep_time = int(os.getenv("SLEEP_TIME", 1))
time.sleep(sleep_time)
remove_previous_container(client)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def get_response_text2() -> str:


def generate_dockerfile_content(name: str) -> str:
content = f"FROM tiangolo/uvicorn-gunicorn:{name}\n"
content = f"FROM shiphero/uvicorn-gunicorn:{name}\n"
content += "COPY ./app /app"
return content

0 comments on commit 2ce8b73

Please sign in to comment.