This commit is contained in:
2021-02-11 18:22:02 +01:00
parent 88a8840b0b
commit 00418aa629
4 changed files with 951 additions and 24 deletions
+32 -21
View File
@@ -1,6 +1,6 @@
# En françaiS Docker Environement (drupal api + vuejs client)
En FrançaiS powered by druapl 8 for the api and vuejs for the client in docker environement (nginx, php:7-fpm+drush, phpmyadmin, redis, npm)
En FrançaiS powered by druapl 9 for the api and vuejs for the app (client) in docker environement (nginx, php:7-fpm+drush, mysql, phpmyadmin, redis, npm)
## Install docker
```
@@ -9,18 +9,18 @@ sudo pacman -S docker docker-compose docker-machine
## Clone this repos
this will clone this repos (main docker environement) and the edlp drupal 8 source code (without sites/default folder)
this will clone this repos (main docker environement), the drupal 9 based api source code (without sites/default folder nor mysq ddb) and the vuejs app source code.
```
git clone --recursive -o figli https://figureslibres.io/gogs/bachir/docker-materio-d8.git
git clone --recursive -o figli https://figureslibres.io/gogs/bachir/docker-enfrancais.git
```
### setup /sites/default/settings.php
```cp -r ressources/default api/web/sites/```
```cp -r ressources/api/* api/src/web/sites/default/```
### get the sites/default/files folder
get the files from where you have it and rsync it to api/web/sites/default/files/
rsync the files from you know where (if you don't, you don't) to api/src/web/sites/default/files/
## Mysql
Copy your-sql-dump.sql into ./ressources/enfrancais.sql
@@ -111,6 +111,8 @@ only before the first run (may take some time)
```
make build
```
/!\ DO NOT use ```docker-compose build```, it will faile
### run
then each time you want to launch the app
```
@@ -121,53 +123,62 @@ Be aware that a first up, since the db is empty, it will be populated with your
## Druapal Composer install
Only at first up, finish to install drupal composer dependencies
```
make exec_php
make exec_api
composer install
```
## Visualize
You can now visit http://dev.enfrancais.fr on your browser
You can now visit :
the app http://dev.enfrancais.fr
or the api http://dev.enfrancais.fr/api
on your browser
## Coding
### drush
you can access to drush by loging into the php container
```
make exec_php
make exec_api
```
once inside the php container in /var/www/html you can use drush as usual
## updateding manualy mysql db
copy your db backup into the mysql container
```
```sh
sudo docker cp your-db-file.sql enfrancais_mysql_1:/root/
```
log into mysql container
```
```sh
make exec_mysql
```
once inside the mysql container you can use mysql command to drop then create and load the db with your file
```
mysql -uroot -penfrancais
> drop database enfrancais;
> create database enfrancais;
> exit;
mysql -uroot -penfrancais enfrancais < your-db-file.sql
```
## Makefile
do not use directly docker or docker-compose to run this instance
DO NOT use directly docker or docker-compose to run this instance
use make instead like ```make up```
```makefile
pull:
docker-compose pull
docker-compose pull
build:
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
buildnc:
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
downbuildup: down build up
up:
docker-compose up -d
upbuild:
docker-compose up -d --build
ps:
docker-compose ps
@@ -177,13 +188,13 @@ logs:
down:
docker-compose down
exec_php:
docker exec -it materiod8_php_1 bash
exec_api:
docker exec -it enfrancais_api_1 bash
exec_npm:
docker exec -it materiod8_npm_1 sh
exec_app:
docker exec -it enfrancais_app_1 sh
exec_mysql:
docker exec -it materiod8_mysql_1 bash
docker exec -it enfrancais_mysql_1 bash
```