mirror of
https://github.com/DefectingCat/dotfiles
synced 2025-07-15 16:51:36 +00:00
update php docker compose
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
||||
**/*/.DS_Store
|
||||
lazygit/state.yml
|
||||
tmux/plugins
|
||||
**/*/mysql
|
||||
|
@ -1,14 +1,12 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
web:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "4000:80"
|
||||
volumes:
|
||||
- ./src:/var/www/html
|
||||
- ./conf.d/:/etc/nginx/conf.d/
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
- .:/var/www/html
|
||||
- ./nginx/conf.d/:/etc/nginx/conf.d/
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
links:
|
||||
- php-fpm
|
||||
|
||||
@ -17,8 +15,14 @@ services:
|
||||
platform: linux/amd64
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: qwer1234
|
||||
volumes:
|
||||
- ./mysql:/var/lib/mysql
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 8G
|
||||
|
||||
php-fpm:
|
||||
image: php:7-fpm-alpine
|
||||
volumes:
|
||||
- ./src:/var/www/html
|
||||
- .:/var/www/html
|
||||
|
48
dockerfiles/php/nginx/conf.d/tp.conf
Normal file
48
dockerfiles/php/nginx/conf.d/tp.conf
Normal file
@ -0,0 +1,48 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
root /var/www/html/public;
|
||||
index index.php index.html;
|
||||
|
||||
#error_page 404 /404.html;
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass php-fpm:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php?s=/$1 last;
|
||||
}
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
|
||||
#
|
||||
#location ~ \.php$ {
|
||||
# proxy_pass http://127.0.0.1;
|
||||
#}
|
||||
|
||||
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
|
||||
#
|
||||
|
||||
# deny access to .htaccess files, if Apache's document root
|
||||
# concurs with nginx's one
|
||||
#
|
||||
#location ~ /\.ht {
|
||||
# deny all;
|
||||
#}
|
||||
}
|
||||
|
@ -1,16 +1,13 @@
|
||||
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
Reference in New Issue
Block a user