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

Use Gunicorn in docker container with multiple uvicorn workers

#54
parent 0d8d10a0
Branches
No related tags found
No related merge requests found
......@@ -143,8 +143,13 @@ build-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"
build-publish-docker-container-job:
publish-docker-container-job:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.9.1-debug
......@@ -162,3 +167,10 @@ build-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 ./app /app/app
#! /usr/bin/env bash
# Check Connection to Ceph RGW
python app/check_ceph_connection.py
# Check Connection to OIDC provider
python app/check_oidc_connection.py
# Let the DB start
python app/check_database_connection.py
#!/usr/bin/env bash
set -e
set -x
alembic downgrade base
alembic upgrade head
pytest --cov=app --cov-report=term-missing app/tests "${@}"
#! /usr/bin/env bash
# Check Connection to Ceph RGW
python app/check_ceph_connection.py
# Check Connection to OIDC provider
python app/check_oidc_connection.py
# Let the DB start
python app/check_database_connection.py
./scripts/prestart
# 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.
Please register or to comment