-
-
Save alherd-by/37b2cc35c5e0641165ce to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ubuntu:14.04.1 | |
RUN apt-get update | |
RUN apt-get install -y software-properties-common | |
RUN add-apt-repository -y ppa:nginx/stable | |
RUN apt-get update | |
RUN apt-get install -y wget git nano postfix nginx | |
RUN apt-get install -y php5-cli php5-common php5-mysql php5-sqlite php5-curl php5-fpm php5-json php5-gd php5-mcrypt php5-intl php5-imap php5-tidy php5-mysqlnd php5-dev | |
RUN wget -O /etc/nginx/sites-available/default https://gist.github.com/jbroadway/6369183/raw/682a1ed8078cc39f59c3624f460b128addff95db/nginx-default | |
RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php5/fpm/php.ini | |
RUN echo "daemon off;" >> /etc/nginx/nginx.conf | |
RUN mkdir /var/www | |
EXPOSE 80 | |
CMD service php5-fpm start && nginx |
This file contains hidden or 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 ipv6only=on; | |
root /var/www; | |
index index.php index.html; | |
# Make site accessible from http://localhost/ | |
server_name localhost; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~ \.php$ { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment