Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eec308a0ac | ||
|
|
7d46d33d29 | ||
|
|
0d597011c7 | ||
|
|
38c1ddeda4 | ||
|
|
53255d8fd3 | ||
|
|
a2d4b9370c | ||
|
|
acd3a53ff9 | ||
|
|
7c2ca44660 | ||
|
|
1238177d1d | ||
|
|
19ad4aa6e9 | ||
|
|
95a8d6c17e | ||
|
|
dbd410c393 | ||
|
|
e4176dbbe4 | ||
|
|
1040eb0811 | ||
|
|
6a819d8b12 | ||
|
|
566cc4886b |
@@ -1,6 +1,6 @@
|
||||
COMPOSE_PROJECT_NAME=edlpd8
|
||||
|
||||
PROJECT_ROOT=./public_html
|
||||
PROJECT_ROOT=./src
|
||||
LEGACY_ROOT=./drupal6
|
||||
LOG_ROOT=./log
|
||||
|
||||
@@ -10,3 +10,5 @@ DB_ROOT_PASSWORD=edlp
|
||||
DB_NAME=edlp_d8
|
||||
DB_USERNAME=edlp
|
||||
DB_PASSWORD=edlp
|
||||
|
||||
XDEBUG_INI=./ressources/xdebug.ini
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
public_html/*
|
||||
src/*
|
||||
drupal6/*
|
||||
log/*
|
||||
*.sql
|
||||
*.back
|
||||
*.sql.gz
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
[submodule "public_html"]
|
||||
path = public_html
|
||||
[submodule "src"]
|
||||
path = src
|
||||
url = https://figureslibres.io/gogs/bachir/edlp_d8.git
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
server {
|
||||
listen 80 default_server;
|
||||
root /var/www/html;
|
||||
root /var/www/html/web;
|
||||
index index.html index.php;
|
||||
server_name *.encyclopediedelaparole.org;
|
||||
|
||||
@@ -29,6 +29,7 @@ server {
|
||||
fastcgi_intercept_errors off;
|
||||
fastcgi_buffer_size 16k;
|
||||
fastcgi_buffers 4 16k;
|
||||
fastcgi_read_timeout 150;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
|
||||
+54
-16
@@ -1,30 +1,68 @@
|
||||
FROM php:7.0-fpm
|
||||
|
||||
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
|
||||
FROM php:8.1-fpm
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libmcrypt-dev \
|
||||
libpng-dev \
|
||||
mysql-client \
|
||||
zip && \
|
||||
docker-php-ext-install -j$(nproc) mcrypt iconv && \
|
||||
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
|
||||
default-mysql-client \
|
||||
zip \
|
||||
net-tools iproute2 \
|
||||
libzip-dev
|
||||
|
||||
# ENV TZ=Europe/Paris
|
||||
RUN apt-get install -y tzdata && \
|
||||
echo "Europe/Paris" > /etc/timezone && \
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
|
||||
# docker-php-ext-install -j$(nproc) iconv && \
|
||||
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
|
||||
apt-get install -y imagemagick libmagickwand-dev && \
|
||||
pecl install imagick && docker-php-ext-enable imagick && \
|
||||
docker-php-ext-install -j$(nproc) gd && \
|
||||
docker-php-ext-install pdo_mysql zip && \
|
||||
docker-php-ext-install opcache && \
|
||||
docker-php-ext-install bcmath && \
|
||||
apt-get install -y git vim && \
|
||||
pecl install redis-3.1.0 && \
|
||||
pecl install xdebug-2.5.0 && \
|
||||
pecl install redis-5.3.7 && \
|
||||
pecl install xdebug-3.1.3 && \
|
||||
docker-php-ext-enable redis xdebug
|
||||
|
||||
RUN export COMPOSER_HOME=/usr/local/composer && \
|
||||
curl -sS https://getcomposer.org/installer \
|
||||
| php -- --install-dir=/usr/local/bin --filename=composer && \
|
||||
curl https://drupalconsole.com/installer \
|
||||
-L -o /usr/local/bin/drupal && \
|
||||
chmod +x /usr/local/bin/drupal && \
|
||||
curl https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar \
|
||||
-L -o /usr/local/bin/drush && \
|
||||
chmod +x /usr/local/bin/drush
|
||||
| php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
|
||||
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
|
||||
# COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
|
||||
|
||||
|
||||
ARG USER_UID
|
||||
ARG USER_UNAME
|
||||
ARG USER_GID
|
||||
ARG USER_GNAME
|
||||
|
||||
RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
|
||||
groupadd -g ${USER_GID} ${USER_GNAME} &&\
|
||||
useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
|
||||
echo ${USER_UNAME}:${USER_UNAME} | chpasswd &&\
|
||||
install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
|
||||
chown --changes --silent --no-dereference --recursive \
|
||||
--from=33:33 ${USER_UID}:${USER_GID} \
|
||||
/home/${USER_UNAME}
|
||||
# /.composer \
|
||||
# /var/run/php-fpm \
|
||||
# /var/lib/php/sessions \
|
||||
|
||||
COPY ./bashrc /home/${USER_UNAME}/.bashrc
|
||||
COPY ./inputrc /home/${USER_UNAME}/.inputrc
|
||||
|
||||
# https://stackoverflow.com/questions/36964652/ssh-in-docker-container-causes-http-404
|
||||
# use \n to make the content into multiple lines
|
||||
# RUN printf "whoami\nphp-fpm -D\n/usr/sbin/sshd -D" >> /start.sh
|
||||
# RUN chmod +x /start.sh
|
||||
# CMD ["/start.sh"]
|
||||
|
||||
|
||||
# USER ${USER_UNAME}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
PS1='\e[36m\e[1medlpd8-PHP\e[0m:\e[90m\w\e[0m\n$ '
|
||||
bind '"\e[A": history-search-backward'
|
||||
bind '"\e[B": history-search-forward'
|
||||
@@ -0,0 +1,2 @@
|
||||
set show-all-if-ambiguous on
|
||||
set completion-ignore-case on
|
||||
@@ -1,3 +1,4 @@
|
||||
memory_limit = 512M
|
||||
memory_limit = -1
|
||||
upload_max_filesize = 50M
|
||||
post_max_size = 50M
|
||||
max_execution_time = 30
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
[www]
|
||||
;user = www-data
|
||||
;group = www-data
|
||||
;listen = 0.0.0.0:9000
|
||||
;pm = dynamic
|
||||
;pm.max_children = 5
|
||||
;pm.start_servers = 2
|
||||
;pm.min_spare_servers = 1
|
||||
;pm.max_spare_servers = 3
|
||||
|
||||
catch_workers_output = yes
|
||||
php_admin_flag[log_errors] = on
|
||||
php_admin_flag[display_errors] = off
|
||||
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
|
||||
php_admin_value[error_log] = /var/log/error.log
|
||||
access.log = /var/log/access.log
|
||||
php_value[memory_limit] = 512M
|
||||
php_value[post_max_size] = 50M
|
||||
php_value[upload_max_filesize] = 50M
|
||||
php_value[max_execution_time] = 150
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/make
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
USER_UID := $(shell id -u)
|
||||
USER_UNAME := $(shell id -un)
|
||||
USER_GID := $(shell id -g)
|
||||
USER_GNAME := $(shell id -gn)
|
||||
|
||||
DATE_NOW := $(shell date '+%Y-%m-%d_%H%M%S')
|
||||
|
||||
export USER_UID
|
||||
export USER_UNAME
|
||||
export USER_GID
|
||||
export USER_GNAME
|
||||
|
||||
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)
|
||||
|
||||
buildsolrnc:
|
||||
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) solr-new
|
||||
|
||||
buildphp:
|
||||
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) php
|
||||
|
||||
buildphpnc:
|
||||
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) php
|
||||
|
||||
up:
|
||||
docker-compose up -d
|
||||
|
||||
upbuild:
|
||||
docker-compose up -d --build
|
||||
|
||||
ps:
|
||||
docker-compose ps
|
||||
|
||||
logs:
|
||||
docker-compose logs -f
|
||||
|
||||
logs_redis:
|
||||
docker-compose logs -f redis
|
||||
|
||||
down:
|
||||
docker-compose down
|
||||
|
||||
restart_redis:
|
||||
docker-compose restart redis
|
||||
|
||||
restart_php:
|
||||
docker-compose restart php
|
||||
|
||||
restart_npm :
|
||||
docker-compose restart npm
|
||||
|
||||
exec_php:
|
||||
docker exec -it edlpd8-php-1 bash
|
||||
|
||||
exec_npm:
|
||||
docker exec -it edlpd8-npm-1 sh
|
||||
|
||||
exec_mysql:
|
||||
docker exec -it edlpd8-mysql-1 bash
|
||||
|
||||
redis:
|
||||
docker exec -it edlpd8-redis-1 bash
|
||||
|
||||
dump_d8_db:
|
||||
docker exec edlpd8-mysql-1 sh -c 'exec mysqldump -uroot -pedlp edlp_d8' > ./ressources/edlp-d8-$(DATE_NOW)-local.sql
|
||||
@@ -33,16 +33,17 @@ add to your /etc/hosts :
|
||||
127.0.0.1 dev.encyclopediedelaparole.org
|
||||
127.0.0.1 dev.phpmyadmin.encyclopediedelaparole.org
|
||||
```
|
||||
configure your apache vhosts to add a reverse proxy that will redirect the dev.encyclopediedelaparole.org to our container
|
||||
```
|
||||
configure your apache or nginx vhosts to add a reverse proxy that will redirect the dev.encyclopediedelaparole.org to our container
|
||||
|
||||
apache
|
||||
```apache
|
||||
<Virtualhost *:80>
|
||||
ServerName dev.encyclopediedelaparole.org
|
||||
ProxyPass / http://127.0.0.1:8880/
|
||||
ProxyPassReverse / http://127.0.0.1:8880/
|
||||
ProxyRequests Off
|
||||
</Virtualhost>
|
||||
```
|
||||
```
|
||||
|
||||
<Virtualhost *:80>
|
||||
ServerName dev.phpmyadmin.encyclopediedelaparole.org
|
||||
ProxyPass / http://127.0.0.1:8881/
|
||||
@@ -50,6 +51,37 @@ configure your apache vhosts to add a reverse proxy that will redirect the dev.e
|
||||
ProxyRequests Off
|
||||
</Virtualhost>
|
||||
```
|
||||
|
||||
nginx
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name dev.encyclopediedelaparole.org;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name dev.phpmyadmin.encyclopediedelaparole.org;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Docker
|
||||
|
||||
### build
|
||||
@@ -83,9 +115,9 @@ sudo docker exec -it edlpd8_php_1 bash
|
||||
once inside the php container in /var/www/html you can use drush as usual
|
||||
|
||||
### gulp
|
||||
Dev process needs gulp to run in:
|
||||
Dev process needs gulp to run in:
|
||||
- public_html/sites/all/modules/figli/edlp_corpus/
|
||||
- public_html/sites/all/themes/custom/edlptheme/
|
||||
- public_html/sites/all/themes/custom/edlptheme/
|
||||
if you have to modifie js or scss source code, you need to do in each of these 2 folder:
|
||||
```
|
||||
npm install
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
DATE=`date '+%Y-%m-%d %H:%M:%S'`
|
||||
#SCRIPT_D=dirname $0
|
||||
|
||||
#export $(cat ${SCRIPT_D}/../.env | grep -v ^# | xargs)
|
||||
|
||||
sudo docker exec edlpd8_mysql_1 sh -c 'exec mysqldump -uroot -p"$MYSQL_ROOT_PASSWORD" edlp_d8' > "./edlp_d8-${DATE}.sql"
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
rsync --delete -ruv CT-edlp-deb9:www/encyclopediedelaparole.org/public_html/sites/default/files/ ./public_html/sites/default/files/ --exclude=js/* --exclude=php/* --exclude=styles/* --exclude=css/*
|
||||
+9
-4
@@ -1,5 +1,3 @@
|
||||
version: "3.5"
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mariadb:latest
|
||||
@@ -47,12 +45,19 @@ services:
|
||||
- 9000
|
||||
volumes:
|
||||
- php-root-data:/root
|
||||
- ./Docker/php/phpSettings.conf:/usr/local/etc/php-fpm.d/zzz-phpSettings.conf
|
||||
- "${LOG_ROOT}:/var/log:rw"
|
||||
- "${PROJECT_ROOT}:/var/www/html"
|
||||
- "${LEGACY_ROOT}:/var/www/drupal6"
|
||||
- "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
|
||||
networks:
|
||||
- database
|
||||
- redis
|
||||
- server
|
||||
# for xdebug
|
||||
# https://github.com/docker/for-linux/issues/264#issuecomment-965465879
|
||||
extra_hosts:
|
||||
- host.docker.internal:host-gateway
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
@@ -61,7 +66,7 @@ services:
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
ports:
|
||||
- 8881:80
|
||||
- 8883:80
|
||||
networks:
|
||||
- database
|
||||
depends_on:
|
||||
@@ -72,7 +77,7 @@ services:
|
||||
nginx:
|
||||
build: ./Docker/nginx/
|
||||
ports:
|
||||
- 8880:80
|
||||
- 8882:80
|
||||
volumes:
|
||||
- "${PROJECT_ROOT}:/var/www/html"
|
||||
- "${LOG_ROOT}:/var/log:rw"
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Druapl 6 legacy for file migration
|
||||
|
||||
you need to add here your sites/default/files folder from drupal 6
|
||||
-1
Submodule public_html deleted from 9d75870f04
@@ -0,0 +1,50 @@
|
||||
[xdebug]
|
||||
; xdebug.remote_enable=1
|
||||
xdebug.mode=debug
|
||||
|
||||
;Should use host.docker.internal but not working on linux
|
||||
; xdebug.remote_host=172.20.0.1
|
||||
; Replaced by xdebug.client_host.
|
||||
xdebug.client_host=host.docker.internal
|
||||
|
||||
|
||||
;Not working on docker context
|
||||
; xdebug.remote_connect_back=0
|
||||
; Replaced by xdebug.discover_client_host.
|
||||
xdebug.discover_client_host=0
|
||||
|
||||
|
||||
;9000 is already bound by php-fpm
|
||||
; xdebug.remote_port=9001
|
||||
; xdebug.remote_port #
|
||||
; Replaced by xdebug.client_port.
|
||||
; The default value has also changed from 9000 to 9003.
|
||||
xdebug.client_port=9001
|
||||
|
||||
xdebug.remote_handler=dbgp
|
||||
|
||||
; xdebug.remote_mode=req
|
||||
; xdebug.remote_mode #
|
||||
; For the req value (the original default), use xdebug.mode=debug with xdebug.start_with_request=trigger. If the original xdebug.remote_autostart behaviour is necessary, use xdebug.start_with_request=yes instead of trigger.
|
||||
|
||||
; For the jit value, use xdebug.mode=debug and xdebug.start_upon_error=yes.
|
||||
|
||||
|
||||
; xdebug.remote_autostart=true
|
||||
; Use xdebug.mode=debug with xdebug.start_with_request=yes
|
||||
xdebug.start_with_request=yes
|
||||
|
||||
; ?=XDEBUG_SESSION_START=1
|
||||
;Log file is mounted on volume so you can follow it
|
||||
; xdebug.remote_log=/var/log/xdebug-error.log
|
||||
; Replaced by xdebug.log, which also includes log messages beyond Step Debugging.
|
||||
xdebug.log=/var/log/xdebug-error.log
|
||||
|
||||
; xdebug.profiler_enable=0
|
||||
; xdebug.profiler_enable_trigger=1
|
||||
; Use xdebug.mode=profile with xdebug.start_with_request=trigger.
|
||||
xdebug.profiler_output_name = cachegrind.out.%t.%R
|
||||
xdebug.output_dir=/var/log/
|
||||
; Use the generic xdebug.output_dir setting.
|
||||
|
||||
; Example: http://localhost:8080/test?XDEBUG_PROFILE=1
|
||||
Submodule
+1
Submodule src added at b48fba3311
Reference in New Issue
Block a user