nginx, php in docker

This commit is contained in:
marko
2024-06-30 09:01:58 +02:00
parent b86a672809
commit 15111e3e1a
4 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1 @@
<h1>Hello, World!</h1>

View File

@@ -0,0 +1,2 @@
<?
phpinfo();

View File

@@ -0,0 +1,19 @@
# version for the docker compose file to use
version: "3"
# a dict of services running in the container label: {<service>} label is a self defined name for the service
services:
# the web service
web:
image: nginx:latest
# port forwarding
ports:
# forward port 80 top port 80 in the container
- "80:80"
# files and directories to be available in the container
volumes:
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf
- ./app:/app
php:
image: php:fpm
volumes:
- ./app:/app

View File

@@ -0,0 +1,12 @@
server {
listen 80 default_server;
root /app/public;
index index.php index.html index.htm;
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}