From b3b04a0af033dcc77ce25728a90414d515147337 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Sun, 28 Nov 2021 18:46:55 -0500 Subject: [PATCH] better api image --- Makefile | 4 ++-- api/.dockerignore | 5 ++++- api/Dockerfile | 8 ++++---- api/entrypoint.sh | 0 charts/demo-helm/values.yaml | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) mode change 100644 => 100755 api/entrypoint.sh diff --git a/Makefile b/Makefile index a3d294b..82b0085 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ REGISTRY_NAME=registry.runcible.io FRONTEND_IMAGE_NAME=$(REGISTRY_NAME)/demo-helm-frontend -FRONTEND_IMAGE_VERSION=1.2.0 +FRONTEND_IMAGE_VERSION=1.3.0 API_IMAGE_NAME=$(REGISTRY_NAME)/demo-helm-api -API_IMAGE_VERSION=1.2.0 +API_IMAGE_VERSION=1.3.0 push-app-image: build-app-image docker push $(FRONTEND_IMAGE_NAME):$(FRONTEND_IMAGE_VERSION) diff --git a/api/.dockerignore b/api/.dockerignore index 7afccac..9e050ed 100644 --- a/api/.dockerignore +++ b/api/.dockerignore @@ -1,2 +1,5 @@ requirements.in -.env \ No newline at end of file +.env +tests/ +Dockerfile +./api/.env \ No newline at end of file diff --git a/api/Dockerfile b/api/Dockerfile index 63957a8..774652c 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -18,8 +18,7 @@ COPY requirements.txt . RUN pip install --no-cache -r requirements.txt # Install app -COPY wsgi.py ./ -COPY api/ ./api/ +COPY . . # Chown all the files to the app user RUN chown -R app:app $APP_HOME @@ -27,6 +26,7 @@ RUN chown -R app:app $APP_HOME # Change to the app user USER app -ENTRYPOINT ["/usr/bin/tini", "--"] +ENTRYPOINT ["./entrypoint.sh"] -CMD ["gunicorn", "--log-level=debug", "-b", "0.0.0.0:5000", "wsgi:app"] +CMD ["gunicorn", "--worker-tmp-dir", "/dev/shm", "--workers=2", "--log-level=-", "--threads=4", \ + "--worker-class", "gthread", "--bind", "0.0.0.0:5000", "wsgi:app"] diff --git a/api/entrypoint.sh b/api/entrypoint.sh old mode 100644 new mode 100755 diff --git a/charts/demo-helm/values.yaml b/charts/demo-helm/values.yaml index 3e5e5f4..05ca1f4 100644 --- a/charts/demo-helm/values.yaml +++ b/charts/demo-helm/values.yaml @@ -3,10 +3,10 @@ image_pull_secret: regcred services: frontend: image_name: "registry.runcible.io/demo-helm-frontend" - image_version: "1.2.0" + image_version: "1.3.0" replicas: 1 backend: image_name: "registry.runcible.io/demo-helm-api" - image_version: "1.2.0" + image_version: "1.3.0" replicas: 1 random: "tis-random-default" \ No newline at end of file