Last active
August 29, 2018 00:31
-
-
Save kiramishima/b7eb15a8cac64800be5dd0e4a6ee5084 to your computer and use it in GitHub Desktop.
Ejemplo de Docker con PHP y Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
index index.php index.html; | |
server_name localhost; | |
error_log /var/log/nginx/error.log; | |
access_log /var/log/nginx/access.log; | |
root /home/sample.com/apps/code/public; | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass php:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
web: | |
build: | |
context: ./php | |
dockerfile: sample.DockerFile | |
ports: | |
- "80:80" | |
networks: | |
- code-network | |
links: | |
- php | |
php: | |
image: php:7-fpm | |
volumes: | |
- ./php/code:/home/sample.com/apps/code | |
networks: | |
- code-network | |
networks: | |
code-network: | |
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo "Hola amiguito estamos corriendo gracias a Docker"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:alpine | |
COPY ./code /home/sample.com/apps/code | |
COPY ./conf/default.conf /etc/nginx/conf.d/default.conf | |
EXPOSE 80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment