Fix log files + README
This commit is contained in:
34
Makefile
34
Makefile
@@ -5,27 +5,43 @@ ifeq ($(origin .RECIPEPREFIX), undefined)
|
||||
endif
|
||||
.RECIPEPREFIX = >
|
||||
.DEFAULT_GOAL := help
|
||||
.PHONY: init create-dir set-acl update run help
|
||||
.PHONY: init upgrade up help clear-log
|
||||
|
||||
DC=docker-compose
|
||||
XDEBUGFILE="data/log/xdebug/xdebug.log"
|
||||
SETFACL=sudo setfacl -R -m u:${USER}:rwX,d:u:${USER}:rwX
|
||||
CHOWN=sudo chown -R
|
||||
|
||||
init: create-dir set-acl update
|
||||
WWW=${HOME}/public
|
||||
|
||||
init: create-dir set-acl upgrade
|
||||
|
||||
create-dir:
|
||||
> mkdir -p data/log/{mysql,nginx,php,xdebug}
|
||||
> touch $(XDEBUGFILE)
|
||||
> 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:
|
||||
> sudo setfacl -R -m u:${USER}:rwX,d:u:${USER}:rwX data
|
||||
> sudo chown 82:82 $(XDEBUGFILE)
|
||||
> $(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
|
||||
|
||||
update:
|
||||
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
|
||||
|
||||
run:
|
||||
up:
|
||||
> $(DC) up
|
||||
|
||||
help:
|
||||
> @printf "Usage : make [init|update|set-acl|run]"
|
||||
> @printf "Usage : make [init|upgrade|set-acl|clear-log|up]"
|
47
README.md
Normal file
47
README.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# 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
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
@@ -30,7 +30,7 @@ http {
|
||||
#client_max_body_size 30M;
|
||||
}
|
||||
|
||||
access_log /var/log/access.log;
|
||||
error_log /var/log/error.log error;
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log error;
|
||||
}
|
||||
}
|
||||
|
@@ -6,9 +6,6 @@ php_admin_flag[log_errors] = on
|
||||
php_admin_value[memory_limit] = 32M
|
||||
php_flag[display_startup_errors] = on
|
||||
|
||||
access.log = /var/log/php/access.log
|
||||
;error.log = /var/log/error.log
|
||||
|
||||
catch_workers_output = yes
|
||||
|
||||
; for debugging 1h
|
||||
|
@@ -17,15 +17,15 @@ mailcatcher:
|
||||
|
||||
php:
|
||||
build: phpfpm
|
||||
expose:
|
||||
- 9000
|
||||
volumes:
|
||||
- ~/public:/var/www/html
|
||||
- ./data/log/xdebug:/var/log/xdebug
|
||||
- ./data/log/php:/var/log/php
|
||||
- ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||
- ./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
|
||||
|
Reference in New Issue
Block a user