update readme
This commit is contained in:
parent
0a0cdf1c9e
commit
299b0d8dee
168
README.md
168
README.md
@ -1,92 +1,9 @@
|
||||
Environnement de développement Docker pour démarrer un nouveau projet Symfony5
|
||||
==================================
|
||||
|
||||
On repart de 1_docker_ready, et la procédure d'installation s'adapte comme ceci:
|
||||
## En partant de la branche *5_start_new-project*
|
||||
|
||||
# Adaptations de la procédure d'installation
|
||||
|
||||
## 1. se mettre sur la bonne branche
|
||||
|
||||
```bash
|
||||
$ git co -b 1_docker_ready origin/1_docker_ready
|
||||
```
|
||||
|
||||
## 2. builder le projet
|
||||
|
||||
```bash
|
||||
$ docker-compose build
|
||||
$ docker-compose up
|
||||
.. 221001_test3_db_1 exited with code 1
|
||||
```
|
||||
|
||||
## 3. parce que 'db' ne se lance pas:
|
||||
|
||||
```bash
|
||||
$ docker-compose rm db
|
||||
$ sudo rm -rf ./data
|
||||
$ docker-compose up db
|
||||
```
|
||||
|
||||
## 4. entrer dans php
|
||||
|
||||
```bash
|
||||
$ docker-compose exec -u 1000 php bash
|
||||
```
|
||||
|
||||
## 5. create project
|
||||
|
||||
```bash
|
||||
$ symfony new tadaam
|
||||
$ mv tadaam/* . && mv tadaam/.* . && rmdir tadaam
|
||||
```
|
||||
|
||||
## 6. composer require la base
|
||||
|
||||
```bash
|
||||
$ composer require doctrine/annotations twig/twig doctrine/orm symfony/orm-pack symfony/form symfony/maker-bundle symfony/security-csrf
|
||||
```
|
||||
|
||||
## 7. connexion postgresql
|
||||
|
||||
modifier DATABASE_URL dans app/.env :
|
||||
```bash
|
||||
+++ DATABASE_URL="postgresql://postgres:secret@db:5432/postgres?serverVersion=12&charset=utf8"
|
||||
```
|
||||
|
||||
et dans le conteneur php :
|
||||
```bash
|
||||
$ bin/console doctrine:schema:create
|
||||
```
|
||||
|
||||
## 8. composer require, la suite..
|
||||
|
||||
```bash
|
||||
$ composer require symfony/yaml symfony/twig-bridge symfony/validator
|
||||
|
||||
$ composer require symfony/asset symfony/expression-language symfony/security-http symfony/translation symfony/web-link egulias/email-validator symfony/expression-language symfony/intl symfony/translation
|
||||
|
||||
$ composer require --dev symfony/profiler-pack symfony/debug-bundle symfony/var-dumper
|
||||
```
|
||||
|
||||
## 9. Yarn
|
||||
|
||||
```bash
|
||||
$ composer require symfony/webpack-encore-bundle
|
||||
```
|
||||
|
||||
mettre en place le script qui lance docker node, le lancer pour entrer dans le conteneur node:
|
||||
```bash
|
||||
$ yarn install --force
|
||||
$ yarn add sass sass-loader
|
||||
$ yarn encore dev-server
|
||||
```
|
||||
|
||||
## 10. c'est fait
|
||||
|
||||
le site est disponible sur http://localhost:8000
|
||||
|
||||
|
||||
# Et si on part de 5_start_new-project
|
||||
Le projet, symfony et ses dépendances sont prêt à être installé.
|
||||
|
||||
```
|
||||
$ docker-compose build
|
||||
@ -108,6 +25,87 @@ $ bash docker-node.sh yarn install --force
|
||||
$ bash docker-node.sh yarn encore dev-server
|
||||
```
|
||||
|
||||
Voilà, le site est disponible sur http://localhost:8000
|
||||
|
||||
|
||||
## En partant de la branche *1_docker_ready*
|
||||
|
||||
### 1. Se mettre sur la bonne branche
|
||||
|
||||
```bash
|
||||
$ git co -b 1_docker_ready origin/1_docker_ready
|
||||
```
|
||||
|
||||
### 2. Construire les images et les conteneurs
|
||||
|
||||
```bash
|
||||
$ docker-compose build
|
||||
$ docker-compose up
|
||||
.. 221001_test3_db_1 exited with code 1
|
||||
```
|
||||
|
||||
### 3. Parce que 'db' ne se lance pas:
|
||||
|
||||
```bash
|
||||
$ docker-compose rm db
|
||||
$ sudo rm -rf ./data
|
||||
$ docker-compose up db
|
||||
```
|
||||
|
||||
### 4. Entrer dans le conteneur php
|
||||
|
||||
```bash
|
||||
$ docker-compose exec -u 1000 php bash
|
||||
```
|
||||
|
||||
### 5. Créer le projet
|
||||
|
||||
```bash
|
||||
$ symfony new project
|
||||
$ mv project/* . && mv project/.* . && rmdir project
|
||||
```
|
||||
|
||||
### 6. Charger les dépendances de composer
|
||||
|
||||
```bash
|
||||
$ composer require doctrine/annotations twig/twig doctrine/orm symfony/orm-pack symfony/form symfony/maker-bundle symfony/security-csrf
|
||||
```
|
||||
|
||||
### 7. Connexion à postgresql
|
||||
|
||||
modifier DATABASE_URL dans app/.env :
|
||||
```bash
|
||||
+++ DATABASE_URL="postgresql://postgres:secret@db:5432/postgres?serverVersion=12&charset=utf8"
|
||||
```
|
||||
|
||||
et dans le conteneur php :
|
||||
```bash
|
||||
$ bin/console doctrine:schema:create
|
||||
```
|
||||
|
||||
### 8. Chargement de dépendances, la suite
|
||||
|
||||
```bash
|
||||
$ composer require symfony/yaml symfony/twig-bridge symfony/validator
|
||||
|
||||
$ composer require symfony/asset symfony/expression-language symfony/security-http symfony/translation symfony/web-link egulias/email-validator symfony/expression-language symfony/intl symfony/translation
|
||||
|
||||
$ composer require --dev symfony/profiler-pack symfony/debug-bundle symfony/var-dumper
|
||||
```
|
||||
|
||||
### 9. Installer node et yarn
|
||||
|
||||
```bash
|
||||
$ composer require symfony/webpack-encore-bundle
|
||||
```
|
||||
|
||||
mettre en place le script qui lance docker node, le lancer pour entrer dans le conteneur node:
|
||||
```bash
|
||||
$ yarn install --force
|
||||
$ yarn add sass sass-loader
|
||||
$ yarn encore dev-server
|
||||
```
|
||||
|
||||
### 10. C'est installé !
|
||||
|
||||
le site est disponible sur http://localhost:8000
|
||||
|
Loading…
Reference in New Issue
Block a user