Skip to content
Snippets Groups Projects
Verified Commit e75883d4 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Use Gunicorn in docker container with multiple uvicorn workers

#40
parent 201d483d
No related branches found
No related tags found
2 merge requests!69Delete dev branch,!37Resolve "Publish docker container with Gunicorn"
Pipeline #29529 passed
......@@ -132,6 +132,11 @@ publish-dev-docker-container-job:
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_SHA}"
--destination "${CI_REGISTRY_IMAGE}:dev-latest"
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile-Gunicorn"
--destination "${CI_REGISTRY_IMAGE}:dev-${CI_COMMIT_SHA}-gunicorn"
--destination "${CI_REGISTRY_IMAGE}:dev-latest-gunicorn"
publish-docker-container-job:
stage: deploy
......@@ -151,3 +156,10 @@ publish-docker-container-job:
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1-2)"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1)"
--destination "${CI_REGISTRY_IMAGE}:latest"
- /kaniko/executor
--context "${CI_PROJECT_DIR}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile-Gunicorn"
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}-gunicorn"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1-2)-gunicorn"
--destination "${CI_REGISTRY_IMAGE}:$(echo ${CI_COMMIT_TAG} | cut -d'.' -f1)-gunicorn"
--destination "${CI_REGISTRY_IMAGE}:latest-gunicorn"
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10-slim
EXPOSE 8000
ENV PORT=8000
RUN apt-get update && apt-get -y install curl
HEALTHCHECK --interval=35s --timeout=4s CMD curl -f http://localhost:$PORT/health || exit 1
COPY ./scripts/prestart.sh /app/prestart.sh
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY ./mako_templates /app/mako_templates
COPY ./app /app/app
......@@ -72,7 +72,7 @@ class GitRepository(ABC):
async def check_file_exists(self, filepath: str, client: AsyncClient) -> bool:
"""
Check that a file exists in the Git Repository
Check if a file exists in the Git Repository
Parameters
----------
......@@ -91,6 +91,7 @@ class GitRepository(ABC):
async def check_files_exist(self, files: list[str], client: AsyncClient, raise_error: bool = True) -> list[bool]:
"""
Check if multiple files exists in the Git Repository
Parameters
----------
......
#! /usr/bin/env bash
# Check Connection to Ceph RGW
#python app/check_ceph_connection.py
# Let the DB start
#python app/check_database_connection.py
#! /usr/bin/env bash
# Check Connection to Ceph RGW
python app/check_ceph_connection.py
# Let the DB start
python app/check_database_connection.py
./scripts/prestart.sh
# Start webserver
uvicorn app.main:app --host 0.0.0.0 --port 8000 --no-server-header
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment