bach 1efd396b1c donne | 2 år sedan | |
---|---|---|
Docker | 2 år sedan | |
d7 @ 092758ecb0 | 2 år sedan | |
ressources | 2 år sedan | |
static | 2 år sedan | |
.env | 2 år sedan | |
.gitignore | 2 år sedan | |
.gitmodules | 2 år sedan | |
LICENSE.txt | 2 år sedan | |
Makefile | 2 år sedan | |
README.md | 2 år sedan | |
docker-compose.yml | 2 år sedan |
clameurs-lawebserie.fr powered by druapl 7 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 clameurs drupal 7 source code (without sites/default folder)
git clone --recursive -o origin https://figureslibres.io/gogs/bachir/docker-clameurs
cp -r ressources/default d7/sites/
get the files from where you have it and rsync it to d7/sites/default/files/
Copy your-sql-dump.sql into ./ressources/clameurs.sql
It will be automaticly imported into the mysql container db (only) on the first make up
add to your /etc/hosts :
127.0.0.1 dev.d7.clameurs.fr
127.0.0.1 dev.phpmyadmin.d7.clameurs.fr
configure your apache vhosts to add a reverse proxy that will redirect the dev.clameurs.fr to our container
<Virtualhost *:80>
ServerName dev.clameur.fr
ProxyPass / http://127.0.0.1:8880/
ProxyPassReverse / http://127.0.0.1:8880/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
<Virtualhost *:80>
ServerName dev.phpmyadmin.clameurs.fr
ProxyPass / http://127.0.0.1:8881/
ProxyPassReverse / http://127.0.0.1:8881/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
server {
listen 80;
server_name dev.clameurs.fr;
location / {
proxy_pass http://127.0.0.1:8880;
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.clameurs.fr;
location / {
proxy_pass http://127.0.0.1:8881;
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)
make build
then each time you want to launch the app
make up
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.
You can now visit http://dev.clameurs.fr on your browser
you can access to drush by loging into the php container
make exec_phpd7
once inside the php container you can use drush as usual
## Makefile
do not use directly docker or docker-compose to run this instance
use make instead like ```make up```
```makefile
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)
buildncnginx:
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) nginx
buildncnginx_static:
docker-compose -f docker-compose-static.yml 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) nginx_static
up:
docker-compose up -d
up_static:
docker-compose -f docker-compose-static.yml up -d
down_static:
docker-compose -f docker-compose-static.yml down
restart_nginx:
docker-compose restart nginx
restart_nginx_static:
docker-compose -f docker-compose-static.yml restart nginx_static
# upbuild:
# docker-compose up -d --build
ps:
docker-compose ps
logs:
docker-compose logs -f
down:
docker-compose down
exec_phpd7:
docker exec -it clameurs-phpd7-1 bash
exec_mysqld7:
docker exec -it clameurs-mysqld7-1 bash
exec_nginx:
docker exec -it clameurs-nginx-1 bash
exec_npm:
docker exec -it clameurs-npm-1 sh
dump_d7_db:
docker exec clameurs-mysqld7-1 sh -c 'exec mysqldump -uroot -pperfart perfart' > ./ressources/perfart_d7-$(DATE_NOW)-local.sql
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