maj docker
This commit is contained in:
+15
-9
@@ -1,16 +1,22 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
|
# La partie PHP (ton Dockerfile actuel)
|
||||||
app:
|
app:
|
||||||
build:
|
build: .
|
||||||
context: .
|
container_name: laravel_php
|
||||||
dockerfile: DOCKERFILE
|
|
||||||
container_name: laravel_app
|
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- .:/var/www
|
- .:/var/www
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
networks:
|
# La partie Serveur Web (qui parle à NPM et à PHP)
|
||||||
app-network:
|
web:
|
||||||
external: true # Pour qu'il puisse parler à ton MySQL et ton Proxy
|
image: nginx:alpine
|
||||||
|
container_name: laravel_web
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8000:80" # C'est ce port 8000 qu'il faudra mettre dans NPM !
|
||||||
|
volumes:
|
||||||
|
- .:/var/www
|
||||||
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf # On va créer ce petit fichier
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
root /var/www/public; # ICI est le secret du "Not Found"
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass app:9000; # Il parle au conteneur 'app'
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
gzip_static on;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user