informatica:sistemas_operativos:virtualizacion:docker:docker_compose:nginx_php
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
| informatica:sistemas_operativos:virtualizacion:docker:docker_compose:nginx_php [2020/08/18 16:09] – creado tempwin | informatica:sistemas_operativos:virtualizacion:docker:docker_compose:nginx_php [2020/08/18 16:25] (actual) – tempwin | ||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| ====== Docker Compose: nginx + PHP ====== | ====== Docker Compose: nginx + PHP ====== | ||
| + | |||
| + | Despliegue de una arquitectura multicontenedor compuesta por un servidor web Nginx y un intérprete de PHP. | ||
| + | |||
| + | * Imagen Nginx: https:// | ||
| + | * Imagen PHP: https:// | ||
| <code yaml> | <code yaml> | ||
| version: ' | version: ' | ||
| + | |||
| services: | services: | ||
| - | web: | + | webserver: |
| - | container_name: | + | container_name: |
| - | image: nginx: | + | image: nginx: |
| - | ports: | + | ports: |
| - | - "10000:80" | + | - "80:80" |
| - | volumes: | + | volumes: |
| - | - /home/ | + | - ./htdocs:/ |
| - | - /home/tempwin/ | + | - ./config/nginx/ |
| - | php7: | + | php: |
| - | container_name: | + | container_name: |
| - | build: | + | build: |
| - | dockerfile: Dockerfile | + | # |
| - | context: . | + | context: . |
| - | volumes: | + | volumes: |
| - | - /home/ | + | - ./htdocs:/ |
| + | </ | ||
| + | Contenido del fichero '' | ||
| + | |||
| + | < | ||
| + | server { | ||
| + | listen 80; | ||
| + | index index.php index.html; | ||
| + | server_name localhost; | ||
| + | root / | ||
| + | |||
| + | location ~ \.php$ { | ||
| + | try_files $uri =404; | ||
| + | fastcgi_split_path_info ^(.+\.php)(/ | ||
| + | fastcgi_pass lar-php: | ||
| + | fastcgi_index index.php; | ||
| + | include fastcgi_params; | ||
| + | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
| + | fastcgi_param PATH_INFO $fastcgi_path_info; | ||
| + | } | ||
| + | } | ||
| </ | </ | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | El nombre del host que se le pasa a '' | ||
| + | </ | ||
| + | |||
| + | Contenido del '' | ||
| + | |||
| + | <code yaml> | ||
| + | FROM php: | ||
| + | RUN docker-php-ext-install mysqli pdo_mysql | ||
| + | # RUN docker-php-ext-install session | ||
| + | # RUN docker-php-ext-install pdo | ||
| + | </ | ||
| + | |||
| + | El directorio raíz desde el que el servidor web enviará los documentos está establecido en '' | ||
informatica/sistemas_operativos/virtualizacion/docker/docker_compose/nginx_php.1597759765.txt.gz · Última modificación: por tempwin
