bach 5031a34d03 readme | 8 months ago | |
---|---|---|
Docker | 8 months ago | |
app @ 96da96e96d | 8 months ago | |
.env | 8 months ago | |
.gitignore | 8 months ago | |
.gitmodules | 8 months ago | |
LICENSE.txt | 8 months ago | |
Makefile | 8 months ago | |
README.md | 8 months ago | |
docker-compose.yml | 8 months ago |
popsu-colloque
Popsu Coloque powered by druapl 8 in docker environement (nginx, php:7-fpm+drush, phpmyadmin, redis)
sudo pacman -S docker docker-compose docker-machine
this will clone this repos (main docker environement) and the edlp drupal 8 source code (without sites/default folder)
git clone --recursive -o gogs https://figureslibres.io/gogs/bachir/docker-popsu-coloques.git
### get the sites/default/files folder
get the files from where you have it and rsync it to public_html/sites/default/files/
## Mysql
Copy your-sql-dump.sql into ./ressources/popsucolloque21.sql & ./ressources/popsucolloque24.sql
It will be automaticly imported into the mysql container db (only) on the first docker-compose up
## Hosts and reverse proxy
add to your /etc/hosts :
127.0.0.1 dev.colloque2021.popsu.archi.fr 127.0.0.1 dev.colloque2024.popsu.archi.fr 127.0.0.1 dev.phpmyadmin.popsucolloques.fr
configure your nginx vhosts to add a reverse proxy that will redirect the dev.popsucolloque21.fr and dev.popsucolloque24.fr to our container
```nginx
server {
listen 80;
server_name dev.colloque2021.popsu.archi.fr dev.colloque2024.popsu.archi.fr;
location / {
proxy_pass http://127.0.0.1:8890;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
server {
listen 80;
server_name dev.phpmyadmin.popsucolloques.fr;
location / {
proxy_pass http://127.0.0.1:8891;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
}
only before the first run (may take some time)
sudo docker-compose build
then each time you want to launch the app
sudo docker-compose up -d
Be aware that a first up, since the db is empty, it will be populated with your file db.sql. It may take some time depending of your db size.
Only at first up, finish to install drupal composer dependencies
sudo docker exec -it popsucoloque_php_1 bash
composer install
You can now visit http://dev.popsu-coloque.com on your browser
you can access to drush by loging into the php container
sudo docker exec -it popsucoloque_php_1 bash
once inside the php container in /var/www/html you can use drush as usual
copy your db backup into the mysql container
sudo docker cp your-db-file.sql popsucoloque_mysql_1:/root/
log into mysql container
sudo docker exec -it popsucoloque_mysql_1 bash
once inside the mysql container you can use mysql command to drop then create and load the db with your file
do not use directly docker or docker-compose to run this instance
use make instead like make up
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)
up:
docker-compose up -d
upbuild:
docker-compose up -d --build
ps:
docker-compose ps
logs:
docker-compose logs -f
down:
docker-compose down
php:
docker exec -it popsucoloque_php_1 bash
phplegacy:
docker exec -it popsucoloque_php-legacy_1 bash
https://www.ostraining.com/blog/drupal/docker/
http://tech.osteel.me/posts/2017/01/15/how-to-use-docker-for-local-web-development-an-update.html
https://mmenozzi.github.io/2016/01/22/php-web-development-with-docker/
https://dzone.com/articles/continuous-drupal-maintaining-a-drupal-website-wit//
https://github.com/glaux/drupal8docker
https://www.jeffgeerling.com/blogs/jeff-geerling/drupal-8-redis-php-7-nginx-and
https://chromatichq.com/blog/configuring-redis-caching-drupal-8