This commit is contained in:
T'JAMPENS QUENTIN p2406187
2025-11-24 23:18:10 +01:00
parent 1f077cfdd2
commit 6c4d03eb6b
3 changed files with 3 additions and 12 deletions
+3
View File
@@ -33,3 +33,6 @@ docker compose up --build -d
docker exec app-php php artisan key:generate docker exec app-php php artisan key:generate
docker exec app-php php artisan migrate docker exec app-php php artisan migrate
``` ```
docker compose stop
docker compose start
-8
View File
@@ -2,27 +2,19 @@
APP_DIR=/var/www/app APP_DIR=/var/www/app
# Vérifie si le repo existe
if [ ! -d "$APP_DIR/.git" ]; then if [ ! -d "$APP_DIR/.git" ]; then
echo "📥 Aucun projet trouvé. Clonage..."
git clone https://oauth2:${GIT_TOKEN}@${GIT_REPO} $APP_DIR git clone https://oauth2:${GIT_TOKEN}@${GIT_REPO} $APP_DIR
else else
echo "🔄 Projet existant. Pull..."
cd $APP_DIR cd $APP_DIR
git pull git pull
fi fi
cd $APP_DIR cd $APP_DIR
# Permissions sur storage et cache
mkdir -p storage bootstrap/cache mkdir -p storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache chown -R www-data:www-data storage bootstrap/cache
chmod -R 775 storage bootstrap/cache chmod -R 775 storage bootstrap/cache
# Composer & artisan
composer install --no-interaction --prefer-dist composer install --no-interaction --prefer-dist
php artisan key:generate --force
php artisan migrate --force
php artisan config:cache
exec php-fpm exec php-fpm
-4
View File
@@ -1,18 +1,14 @@
FROM php:8.4-fpm FROM php:8.4-fpm
# Install dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
git unzip libzip-dev libpng-dev libonig-dev \ git unzip libzip-dev libpng-dev libonig-dev \
&& docker-php-ext-install pdo_mysql zip && docker-php-ext-install pdo_mysql zip
# Install composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# Copy entrypoint
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh
# Working directory
WORKDIR /var/www/app WORKDIR /var/www/app
ENTRYPOINT ["entrypoint.sh"] ENTRYPOINT ["entrypoint.sh"]