25 Commits
php5 ... php8.0

Author SHA1 Message Date
7e018bfe6d Update xdebug config 2020-12-09 10:50:11 +01:00
14076d855e Change for php8.0 2020-12-09 08:25:48 +01:00
00c7bb9358 Mise à jour de 'README.md' 2020-11-12 19:40:01 +00:00
1355684687 Fix log files + README 2020-11-12 20:38:32 +01:00
1de6aaad7f fix xdebug 2020-11-12 20:32:13 +01:00
dcf5e72f8b Fix build problem 2020-11-10 15:33:27 +01:00
956f51612d Remove submodules (really this time) 2020-11-09 13:02:09 +01:00
70d87fe5d1 Add makefile + corrects log file access + Change data location 2020-11-09 12:37:34 +01:00
9a655f9531 Remove submodules (too complicated) 2020-11-09 09:48:51 +01:00
691f5d4e31 Update submodule sources 2020-11-06 08:13:22 +01:00
3ed355a515 Utilise des submodules plutot que des images issues de docker hub. 2018-11-05 14:17:23 +01:00
a936052dd0 WIP : Remets a plat la configuration 2018-02-02 16:32:34 +01:00
8c330bfcd0 Utilise des images pour mailcatcher et phpfpm 2017-04-21 22:38:43 +02:00
d747734ad8 Supprime ligne redondante 2017-02-22 08:59:28 +01:00
52bf0e678a Ajoute la lib php socket 2017-02-22 08:59:07 +01:00
907b831d73 Met à jour xdebug vers la version 2.5.0 2016-12-21 10:43:36 +01:00
3a7a9b6e3b Active le profiler xdebug 2016-11-09 17:57:19 +01:00
5a7697e15d Utilise le port 9000 pour xdebug 2016-11-03 12:14:02 +01:00
9e7616d052 Corrige problème fichier hors contexte 2016-10-26 21:36:21 +02:00
ebf7d095c9 Merge branch 'php7' of github.com:daiko/devphp into php7 2016-09-30 08:31:10 +02:00
90512a3be6 Augmente la taille des fichiers uploadables 2016-09-30 08:30:55 +02:00
fb7a36e4ce Augmente la taille des fichiers uploadables 2016-09-29 10:45:53 +02:00
8a22bc22e0 [WIP] Utilise mailcatcher pour l'envois de mail 2016-09-28 11:26:52 +02:00
200cd26a06 Passe a la version 2.4.1 de xdebug 2016-09-27 16:54:47 +02:00
4b23424ff4 Réorganisation du dépôt 2016-09-27 16:17:40 +02:00
17 changed files with 231 additions and 1983 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/data

47
Makefile Normal file
View File

@@ -0,0 +1,47 @@
SHELL := bash
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
.DEFAULT_GOAL := help
.PHONY: init upgrade up help clear-log
DC=docker-compose
SETFACL=sudo setfacl -R -m u:${USER}:rwX,d:u:${USER}:rwX
CHOWN=sudo chown -R
WWW=${HOME}/public
init: create-dir set-acl upgrade
create-dir:
> mkdir -p data/log/{mysql,nginx,php,xdebug}
> mkdir -p $(WWW)
> touch data/log/xdebug/xdebug.log
> touch data/log/nginx/{access.log,error.log}
> touch data/log/php/fpm.log
set-acl:
> $(SETFACL) data
> $(SETFACL) $(WWW)
> $(CHOWN) 82:82 data/log/{xdebug,php}
> $(CHOWN) 82:82 $(WWW)
> $(CHOWN) root:root data/log/nginx
> $(CHOWN) 999:999 data/log/mysql
> $(CHOWN) 999:999 data/mysql
clear-log:
> truncate -s 0 data/log/{php,nginx}/{access.log,error.log}
> truncate -s 0 data/log/xdebug/xdebug.log
> rm data/log/xdebug/cachegrind*
upgrade:
> $(DC) pull
> $(DC) build --pull
up:
> $(DC) up
help:
> @printf "Usage : make [init|upgrade|set-acl|clear-log|up]"

50
README.md Normal file
View File

@@ -0,0 +1,50 @@
Environnement de développement PHP
==================================
Usage
-----
```bash
# Initialiser l'environnement
make init
# Démarrer
make up
# Mettre à jour
make upgrade
# vider les logs
make clear-log
# remettre a plat les droits
make set-acl
```
Configuration de VSCodium pour utiliser xdebug
----------------------------------------------
Nécessite l'extension PHP debug.
```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"hostname": "172.17.0.1",
"port": 9000,
"pathMappings": {
"/var/www/html": "/home/[user_name]/public"
},
"xdebugSettings": {
"max_data": 65535,
"show_hidden": 1,
"max_children": 100,
"max_depth": 5
}
}
]
}
```

View File

@@ -25,8 +25,12 @@ http {
fastcgi_pass php:9000; fastcgi_pass php:9000;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
fastcgi_read_timeout 180;
include fastcgi_params; include fastcgi_params;
} #fastcgi_read_timeout 180;
#client_max_body_size 30M;
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log error;
} }
} }

12
config/php.conf Normal file
View File

@@ -0,0 +1,12 @@
[www]
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/php/fpm.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 32M
php_flag[display_startup_errors] = on
catch_workers_output = yes
; for debugging 1h
request_terminate_timeout = 3600

21
config/ssmtp.conf Normal file
View File

@@ -0,0 +1,21 @@
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=mailcatcher
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=devphp
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES

17
config/xdebug.ini Normal file
View File

@@ -0,0 +1,17 @@
[xdebug]
zend_extension = xdebug.so
xdebug.mode = debug
xdebug.client_host = 172.17.0.1
xdebug.discover_client_host = yes
xdebug.client_port = 9000
xdebug.idekey = VSCODE
xdebug.remote_handler = dbgp
xdebug.start_with_request = yes
xdebug.force_display_errors = On
xdebug.log = "/var/log/xdebug/xdebug.log"
# Activation du Profiler
xdebug.mode = profile
xdebug.output_dir = "/var/log/xdebug/"
xdebug.profiler_output_name = "cachegrind.%s.out"

View File

@@ -1,15 +0,0 @@
devphp:
image: daiko/php
ports:
- "80:80"
volumes:
- ~/Public:/var/www
links:
- mariadb
mariadb:
image: daiko/mariadb
ports:
- "3306:3306"
volumes:
- ~/.mysql:/var/lib/mysql

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
[xdebug]
zend_extension = xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9042
xdebug.remote_host=172.17.0.1
xdebug.remote_connect_back=1 # Not safe for production servers
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
xdebug.remote_log="/var/log/xdebug/xdebug.log"

View File

@@ -1,47 +0,0 @@
mariadb:
image: mariadb:latest
volumes:
- ~/.mysql:/var/lib/mysql
- ~/log/mysql:/var/log/mysql
expose:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=MyPassWord48
php:
build: ./php-fpm
expose:
- 9000
ports:
- 9042:9042
volumes:
- ~/Public:/var/www/html
- ~/log/php:/var/log/
- ./config/php.ini:/usr/local/etc/php/php.ini
- ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
links:
- mariadb
nginx:
image: nginx:latest
volumes:
- ~/log/nginx:/var/log/nginx
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ~/Public:/var/www/html
ports:
- 80:80
environment:
- NGINX_HOST=localhost
- NGINX_PORT=80
links:
- php
# smtp:
# build: ./smtp
# volumes:
# - ./config/smtpd.conf:/etc/smtpd.conf
# - ./config/mailname:/etc/mailname
# expose:
# - 25

View File

@@ -1,24 +0,0 @@
FROM php:7-fpm
RUN cd /tmp/ && \
curl -O http://pecl.php.net/get/xdebug-2.4.0.tgz && \
tar zxvf xdebug-2.4.0.tgz && \
mv xdebug-2.4.0 /usr/src/php/ext/xdebug
RUN apt-get update && apt-get install -y \
ssmtp \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
&& docker-php-ext-install -j$(nproc) iconv mcrypt gd zip \
&& docker-php-ext-install -j$(nproc) mysqli pdo pdo_mysql \
&& docker-php-ext-install -j$(nproc) xdebug\
&& apt-get purge -y --auto-remove $buildDeps \
&& cd /usr/src/php \
&& make clean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install xdebug

View File

@@ -1,8 +0,0 @@
FROM debian:jessie
RUN echo "deb http://debian.mirrors.ovh.net/debian/ jessie-backports main" >> /etc/apt/sources.list \
&& apt-get update && apt-get install -y \
opensmtpd/jessie-backports \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/usr/sbin/smtpd", "-d"]

45
docker-compose.yml Normal file
View File

@@ -0,0 +1,45 @@
mariadb:
image: mariadb:latest
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/log/mysql:/var/log/mysql
expose:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=MyPassWord48
mailcatcher:
build: mailcatcher
expose:
- 25
ports:
- 1080:1080
php:
build: phpfpm-8.0
volumes:
- ~/public:/var/www/html
- ./data/log/xdebug:/var/log/xdebug
- ./data/log/php:/var/log/php
- ./config/php.conf:/usr/local/etc/php-fpm.d/zzz-settings.conf
- ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
- ./config/ssmtp.conf:/etc/ssmtp/ssmtp.conf
environment:
- XDEBUG_CONFIG=remote_enable=1 remote_autostart=1
links:
- mariadb
- mailcatcher
nginx:
image: nginx:latest
volumes:
- ~/public:/var/www/html
- ./data/log/nginx:/var/log/nginx
- ./config/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
environment:
- NGINX_HOST=localhost
- NGINX_PORT=80
links:
- php

5
mailcatcher/Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM ruby:latest
RUN gem install mailcatcher
ENTRYPOINT ["mailcatcher", "-f", "--ip", "0.0.0.0", "--smtp-port", "25", "--no-quit"]

View File

@@ -1,6 +0,0 @@
devphp:
image: daiko/mapserver-ecw
ports:
- "80:80"
volumes:
- ~/VirtualBox\ VMs/cartesSIG:/var/www/html

28
phpfpm-8.0/Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
FROM php:8.0-fpm-alpine
RUN apk add --update --no-cache \
build-base \
autoconf \
jpeg-dev \
zlib-dev \
libpng-dev \
freetype-dev \
libzip-dev \
oniguruma-dev \
ssmtp \
fish
ENV LIBRARY_PATH=/lib:/usr/lib
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) \
iconv \
gd \
zip \
sockets \
mysqli \
pdo \
pdo_mysql \
mbstring \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug