diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index a8d2ac4da..756abb3ce 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -1,7 +1,6 @@ -FROM python:3.10-alpine +FROM python:3.10.16-alpine3.21 AS builder -ENV PYTHONUNBUFFERED 1 -ENV DJANGO_SETTINGS_MODULE 'config.docker-compose' +ENV PYTHONUNBUFFERED=1 RUN mkdir /code WORKDIR /code @@ -9,14 +8,26 @@ WORKDIR /code ADD requirements.txt /code/ RUN apk add --no-cache postgresql-libs libstdc++ RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ - postgresql-dev rust cargo && \ - python3 -m pip install -r requirements.txt --no-cache-dir && \ - apk --purge del .build-deps + postgresql-dev binutils rust cargo && \ + python3 -m pip install -r requirements.txt --no-cache-dir + +FROM python:3.10.16-alpine3.21 + +ENV PYTHONUNBUFFERED=1 +ENV DJANGO_SETTINGS_MODULE='config.docker-compose' + +RUN mkdir /code +WORKDIR /code + +COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +COPY --from=builder /usr/local/bin /usr/local/bin + ADD . /code/ RUN addgroup -g 1000 -S pokeapi && \ adduser -u 1000 -S pokeapi -G pokeapi - USER pokeapi -CMD gunicorn config.wsgi:application -c gunicorn.conf.py + +CMD ["gunicorn", "config.wsgi:application", "-c", "gunicorn.conf.py"] + EXPOSE 80 diff --git a/Resources/k8s/kustomize/base/other/ingress.yaml b/Resources/k8s/kustomize/base/other/ingress.yaml index 18e3f3d4a..2011842e0 100644 --- a/Resources/k8s/kustomize/base/other/ingress.yaml +++ b/Resources/k8s/kustomize/base/other/ingress.yaml @@ -3,7 +3,6 @@ kind: Ingress metadata: name: pokeapi-ingress annotations: - kubernetes.io/ingress.class: "haproxy" ingress.kubernetes.io/config-backend: | compression algo gzip compression type application/json @@ -13,6 +12,7 @@ spec: name: default-backend port: number: 8080 + ingressClassName: haproxy rules: - http: paths: @@ -29,7 +29,6 @@ kind: Ingress metadata: name: graphql-ingress annotations: - kubernetes.io/ingress.class: "haproxy" ingress.kubernetes.io/config-backend: | http-request replace-path /graphql(.*) \1 spec: @@ -38,6 +37,7 @@ spec: name: default-backend port: number: 8080 + ingressClassName: haproxy rules: - http: paths: diff --git a/requirements.txt b/requirements.txt index 383b8bbd5..2da7d57ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ -Django==3.2.23 +Django==3.2.25 Unipath==1.1 coverage==4.5.4 django-cors-headers==3.14.0 django-discover-runner==1.0 django-redis==4.12.1 -django-cachalot==2.4.2 +django-cachalot==2.4.5 djangorestframework==3.14.0 -gunicorn==21.2.0 +gunicorn==23.0.0 mimeparse==0.1.3 -psycopg2-binary==2.9.9 +psycopg2-binary==2.9.10 python-dateutil==2.8.2 python-mimeparse==1.6.0 drf-spectacular==0.27.2 diff --git a/test-requirements.txt b/test-requirements.txt index 6ebf43ee1..e4cfea180 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,2 @@ -r requirements.txt -pylint===2.8.2 -pylint-django===2.4.4 -astroid==2.5.6 -black==23.11.0 +black==23.12.1