diff --git a/.github/workflows/ci_cd_branch_master.yml b/.github/workflows/ci_cd_branch_master.yml index 946d5ec6e..527378027 100644 --- a/.github/workflows/ci_cd_branch_master.yml +++ b/.github/workflows/ci_cd_branch_master.yml @@ -10,7 +10,7 @@ on: jobs: build_and_test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: python-version: ["3.10"] @@ -49,7 +49,7 @@ jobs: build_and_push_to_dockerhub: needs: build_and_test - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -81,7 +81,7 @@ jobs: # deploy_to_heroku: # needs: build_and_push_to_dockerhub -# runs-on: ubuntu-latest +# runs-on: ubuntu-22.04 # # steps: # - name: Checkout code diff --git a/Dockerfile b/Dockerfile index 19674f0b5..78ca46381 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # Étape 1 : Installation des dépendances de construction # Utilisation de l'image Python 3.7.2 basée sur Alpine Linux -FROM python:3.7.2-alpine AS builder +FROM python:3.10-alpine AS builder # Installation des bibliothèques PostgreSQL RUN apk add --no-cache postgresql-libs @@ -30,7 +30,7 @@ RUN /app/venv/bin/pip install --upgrade pip RUN /app/venv/bin/pip install -r requirements.txt # Étape 3 : Construction de l'image finale -FROM python:3.7.2-alpine +FROM python:3.10-alpine # Configuration du répertoire de travail WORKDIR /app @@ -49,6 +49,10 @@ COPY . /app/ # Copie des dépendances Python de l'étape python-dependencies COPY --from=python-dependencies /app/venv /app/venv +RUN /app/venv/bin/pip install --upgrade pip +RUN apk del .build-deps +RUN apk add zlib-dev jpeg-dev libjpeg + # Collecte des fichiers statiques de l'application RUN /app/venv/bin/python manage.py collectstatic --noinput --settings=oc_lettings_site.settings