add .env.example to frontend and php container and update README.md

This commit is contained in:
2026-01-29 20:09:16 +01:00
parent 7d2af43af4
commit 488fcd273b
7 changed files with 124 additions and 21 deletions
+19 -2
View File
@@ -1,2 +1,19 @@
Aller chercher/générer son token sur gitlab :
Préférences/User settings/Personal access tokens
# Gestion des bénévoles d'une association
## Initialisation
Afin d'initialiser le projet il est requis de :
- Créer un fichier ``.env`` à la racine
- Copier coller le contenu du fichier ``.env.example``
- Remplir les variables du fichier .env
- Pour la variable ``GIT_TOKEN`` il est nécessaire de chercher/générer son token sur gitlab dans l'onglet : ``Préférences/User settings/Personal access tokens``
- Répéter l'opération pour le ``docker/php/.env`` et le ``docker/frontend/.env``
## Installation
Il suffit ensuite d'ouvrir un terminal, de ce placer à la racine de ce projet et d'exécuter les commandes suivantes :
```bash
docker compose down -v
```
```bash
docker compose up --build -d
```
+4 -1
View File
@@ -20,6 +20,7 @@ services:
- "host.docker.internal:host-gateway"
volumes:
- app-code:/var/www/app
- ./docker/php/.env:/tmp/app.env:ro
environment:
- GIT_TOKEN=${GIT_TOKEN}
- BACKEND_GIT_REPO=${BACKEND_GIT_REPO}
@@ -45,8 +46,10 @@ services:
- FRONTEND_GIT_BRANCH=${FRONTEND_GIT_BRANCH}
volumes:
- app-code:/var/www/app
- ./docker/frontend/.env:/tmp/app.env:ro
depends_on:
- php
php:
condition: service_healthy
restart: "no"
nginx:
+1 -1
View File
@@ -3,7 +3,7 @@ FROM alpine:latest
RUN apk add --no-cache mariadb-client bash dcron
RUN mkdir -p /backups
RUN mkdir -p /etc/periodic/15min
RUN mkdir -p /etc/periodic/daily
COPY backup_db.sh /etc/periodic/daily/backup_db
COPY entrypoint.sh /entrypoint.sh
+11
View File
@@ -0,0 +1,11 @@
VITE_API_URL=
VITE_BROADCASTER=reverb
VITE_REVERB_KEY=local
VITE_REVERB_HOST=127.0.0.1
VITE_REVERB_PORT=8080
VITE_FORCE_TLS=false
VITE_DISABLE_STATS=true
VITE_ENCRYPTED=false
VITE_CLUSTER=mt1
VITE_ENABLED_TRANSPORTS=['ws', 'wss']
+4 -8
View File
@@ -27,17 +27,13 @@ fi
cd "$FRONTEND_DIR"
if [ -f package.json ]; then
npm ci --prefer-offline --no-audit
fi
cp /tmp/app.env .env
npm ci --prefer-offline --no-audit
npm run build
if [ ! -d "dist" ]; then
exit 1
fi
find "$PUBLIC_DIR" -mindepth 1 ! -name '.gitkeep' ! -name 'index.php' ! -name '.htaccess' -delete
find "$PUBLIC_DIR" -mindepth 1 ! -name 'index.php' ! -name '.htaccess' -delete
cp -r dist/* "$PUBLIC_DIR/"
exit 0
+79
View File
@@ -0,0 +1,79 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=localhost
SESSION_SECURE_COOKIE=false
BROADCAST_CONNECTION=reverb
REVERB_APP_ID=local
REVERB_APP_KEY=local
REVERB_APP_SECRET=local
REVERB_HOST=reverb
REVERB_PORT=8080
REVERB_SCHEME=http
PUSHER_APP_CLUSTER="mt1"
CACHE_STORE=file
QUEUE_CONNECTION=sync
FILESYSTEM_DISK=local
# CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}"
SANCTUM_STATEFUL_DOMAINS=localhost,127.0.0.1,localhost:8000
TYPESENSE_CONNECTION=typesense
TYPESENSE_API_KEY=xyz
+6 -9
View File
@@ -18,19 +18,16 @@ if [ -f composer.json ]; then
composer update --no-interaction --prefer-dist --optimize-autoloader
fi
if [ ! -f .env ] && [ -f .env.example ]; then
cp .env.example .env
fi
cp /tmp/app.env .env
if [ -f artisan ]; then
if ! grep -q "APP_KEY=base64:" .env 2>/dev/null; then
php artisan key:generate --ansi --force
fi
fi
php artisan key:generate --force
php artisan config:clear
php artisan cache:clear
php artisan migrate --force
chown -R www-data:www-data storage bootstrap/cache public
chown -R www-data:www-data public/ storage bootstrap/cache public vendor
chmod -R 775 storage bootstrap/cache
chmod -R 755 public