Ambiente com PHP e NGINX em único container.
10K+
Acesse o repositório no GitHub abaixo para ter acesso a imagem e instruções de utilização.
Repositório GitHub.
Em /var/www você deve colocar sua aplicação PHP, e esta deve conter uma pasta public que é onde estará o index.php.
Exemplo: /var/www/app_laravel/public/index.php
Em /etc/nginx/sites-available você deve colocar um arquivo do tipo .conf para o nginx conseguir se comunicar a sua aplicação php. Veja o Exemplo abaixo:
server {
listen 80;
server_name localhost;
root /var/www/html/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php index.html;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_read_timeout 600;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Content type
Image
Digest
Size
208.9 MB
Last updated
over 4 years ago
docker pull urnau/php-community