Skip to content

Commit 8ba4599

Browse files
committed
Update taskfiles with apache update
1 parent 8d54387 commit 8ba4599

File tree

3 files changed

+18
-44
lines changed

3 files changed

+18
-44
lines changed

Taskfile.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ includes:
1010
env: ./taskfiles/env/Taskfile.yml
1111
nodejs: ./taskfiles/nodejs/Taskfile.yml
1212
download: ./taskfiles/download/Taskfile.yml
13+
apache: ./taskfiles/apache/Taskfile.yml
1314

1415
vars:
1516
# Variables avec valeurs par défaut depuis .env ou valeurs de fallback
@@ -59,23 +60,23 @@ tasks:
5960
silent: true
6061
cmds:
6162
- rm -rf ./conf/apache2 || true
62-
- docker create --name phpfpm-php koromerzhin/php:8.4.3-apache
6363
- mkdir -p ./conf/apache2
64-
- docker cp phpfpm-php:/etc/apache2/sites-available/000-default.conf ./conf/apache2/000-default.conf
65-
- docker cp phpfpm-php:/etc/apache2/apache2.conf ./conf/apache2/apache2.conf
64+
- task docker:create CONTAINER_NAME=phpfpm-php IMAGE_NAME=$(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}})
65+
- task: docker:getfile
66+
vars:
67+
CONTAINER_NAME: "phpfpm-php"
68+
FILE_PATH: "/etc/apache2/sites-available/000-default.conf"
69+
DEST_PATH: "./conf/apache2/000-default.conf"
70+
- task: docker:getfile
71+
vars:
72+
CONTAINER_NAME: "phpfpm-php"
73+
FILE_PATH: "/etc/apache2/apache2.conf"
74+
DEST_PATH: "./conf/apache2/apache2.conf"
6675
- docker rm -f phpfpm-php
67-
68-
- sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/public|g' ./conf/apache2/000-default.conf
69-
- sed -ri -e 's|#ServerName www.example.com|ServerName {{.SERVERNAME}}|g' ./conf/apache2/000-default.conf
70-
- sed -ri -e 's|\$\{APACHE_DOCUMENT_ROOT\}|/var/www/public|g' ./conf/apache2/apache2.conf
71-
- |
72-
sed -i '/^# Global configuration/a\
73-
#\
74-
# ServerName: Set the servers fully qualified domain name globally\
75-
# This suppresses the warning about not being able to reliably determine\
76-
# the servers fully qualified domain name\
77-
#\
78-
ServerName {{.SERVERNAME}}' ./conf/apache2/apache2.conf
76+
- task: apache:updateconfig
77+
vars:
78+
SERVERNAME: "{{.SERVERNAME}}"
79+
APACHE_DOCUMENT_ROOT: "/var/www/public"
7980

8081
phpfpm:copysql:
8182
desc: "Copie le fichier SQL de dump dans le dossier phpfpm"
@@ -108,7 +109,7 @@ tasks:
108109
desc: "Installation initiale de Composer et des dépendances"
109110
silent: true
110111
cmds:
111-
- docker run --rm -v $(pwd)/apps:/var/www -w /var/www koromerzhin/php:8.4.3-apache composer install
112+
- docker run --rm -v $(pwd)/apps:/var/www -w /var/www $(pwd)/apps:/var/www -w /var/www $(awk '/www:/ {f=1} f && /image:/ {print $2; exit}' {{.DOCKERCOMPOSEFILE}}) composer install
112113

113114
phpfpm:waiting:
114115
desc: "Attend que les services soient opérationnels"

docker-compose.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)