yarn install --force in node container

This commit is contained in:
Tchama 2021-04-17 23:25:27 +02:00
parent f7da84b719
commit 8413dba234
4 changed files with 5265 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,7 +1,10 @@
# Uncomment to ignore Symfony project
#/app/*
/app/.yarncache
!/app/.keep
# Uncomment to ignore Database datas
/data/*
!/data/.keep
.idea

View File

@ -42,3 +42,4 @@ Cette branche démarre d'une installation toute prête de la demo Symfony. La db
+++ DATABASE_URL="postgresql://postgres:secret@db:5432/postgres?serverVersion=12&charset=utf8"
```
* Create database schema: `bin/console doctrine:schema:create`
* `$ composer require symfony/webpack-encore-bundle` and `$ yarn install --force`

5238
app/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

23
docker-node.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Ce script permet de lancer node dans un conteneur docker séparé,
# afin de disposer des outils comme yarn (paquet npm)
# exécute toujours dans le répertoire `php`
cd $(dirname $0)
# la commande exécutée dans le conteneur
if [ $# -eq 0 ]; then
cmd=bash
else
cmd="${@}"
fi
# le conteneur node monte le dossier de l'application
docker run --rm -it \
--user "$(id -u):$(id -g)" \
--volume "${PWD}/app:/app" \
--workdir "/app" \
--env "YARN_CACHE_FOLDER=/app/.yarncache" \
node:14 ${cmd}