Skip to content

Instantly share code, notes, and snippets.

@mlebkowski
Last active December 20, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlebkowski/6212024 to your computer and use it in GitHub Desktop.
Save mlebkowski/6212024 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name local.*;
root /home/docplanner/web;
access_log /dev/fd/1;
error_log /dev/fd/2 error;
index app_dev.php;
try_files $uri @rewrite;
location @rewrite {
rewrite ^/(.*)$ /app_dev.php/$1;
}
location ~ \.php {
fastcgi_index app_dev.php;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# This is to properly handle locale guessing from domain
# Without this the server name is "local.*" even if You access
# http://local.znanylekarz.pl/. Now it's the same as the domain
fastcgi_param SERVER_NAME $host;
}
}
FROM base
MAINTAINER m.lebkowski@gmail.com
RUN echo "deb http://archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y wget nano python-software-properties software-properties-common
RUN add-apt-repository -y ppa:nginx/stable
RUN add-apt-repository -y ppa:ondrej/php5
RUN apt-get update
# something about upstart in a vm box:
RUN dpkg-divert --local --rename --add /sbin/initctl && ln -s /bin/true /sbin/initctl
RUN apt-get install -y nginx
RUN apt-get install --force-yes -y php5-fpm php5-cli php5-mysql php-apc php5-sqlite php5-imagick php5-imap php5-intl php5-memcached php5-mcrypt php5-xdebug
RUN apt-get install --force-yes -y php5-dev
RUN pecl install mongo
# php5-curl php5-gd php5-mongo
RUN wget -O /etc/nginx/sites-available/default https://gist.github.com/mlebkowski/6212024/raw/25caa014dd42db0a3857893355dc2c2393248ce0/nginx.conf
RUN echo "date.timezone = Europe/Warsaw" >> /etc/php5/fpm/php.ini
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
CMD php5-fpm && nginx
EXPOSE 80
ENV SYMFONY_ENV dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment