project_root
├── docker/
│ ├── mysql/
│ ├── nginx/
│ │ ├── ca/
│ │ ├── conf.d/
│ │ │ └── default.conf
│ │ └── nginx.conf
│ └── php-fpm/
│ ├── Dockerfile
│ ├── php.ini
│ └── php.ini-production
├── app/
│ └── file2/
├── public/
├── dir1/
├── dir2/
├── composer.json
└── docker-compose.yml
- 각 OS별로 docker 를 설치
- 터미널에서 다음을 실행하여 php-fpm 소스를 재 컴파일
shell> docker-compose build --force-rm --no-cache
shell> docker-compose up -d
shell> docker exec {image_name} sh -c "composer install --prefer-dist"
server {
listen 80;
server_name localhost;
root /var/www/html/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
error_page 404 /index.php;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
root /var/www/html/public;
fastcgi_pass __DOCKER_PHP_FPM__:9000;
try_files $uri =404;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
shell> docker exec {image_name} sh -c "php artisan route:list"
shell> docker exec {image_name} sh -c "php artisan route:clear"
shell> docker exec {image_name} sh -c "php artisan cache:clear"
shell> docker exec {image_name} sh -c "php artisan optimize"
larabel routing cache 재생성
shell> docker exec {image_name} sh -c "composer dump-autoload"
모든 도커 프로세스 종료
docker stop $(docker ps -a -q)
모든 도커 이미지 삭제
docker rm $(docker ps -a -q)