Copy (for production) or Volume (for development) your code to /var/www and have your index.php at /var/www/public/index.php
any config changes you need to make to nginx should be made copied to /etc/nginx/conf.d/default.template
any declared env vars in that file will be replaced at boot, given this file
server {
listen 80 default_server;
root /var/www/public;
index index.php index.html index.htm;
# vv ENV varible
server_name $SERVER_NAME;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
# vv nginx varible
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
the $SERVER_NAME will be replaced with what you declare in your Dockerfile or by envs varibles passed to docker run
Content type
Image
Digest
Size
292 MB
Last updated
over 9 years ago
docker pull dpspub/stack