Commit fbf5ab27 authored by Dave Lane's avatar Dave Lane

working configuration

parent 14ec0f93
FROM php:7.0-fpm-jessie
MAINTAINER Dave Lane <dave@oerfoundation.org> (@lightweight)
#ENV PHPREDIS_VERSION 3.1.4
RUN apt-get update && apt-get install -y software-properties-common apt-utils
RUN DEBIAN_FRONTEND="noninteractive" add-apt-repository ppa:ondrej/php
ENV DEBIAN_FRONTEND="noninteractive"
#RUN add-apt-repository ppa:ondrej/php
# Install PHP extensions
RUN apt-get update && apt-get install -y apt-utils git less libbz2-dev libc-client-dev \
......@@ -16,18 +16,6 @@ RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos
RUN docker-php-ext-install bz2 curl imap intl mbstring mcrypt \
opcache soap xmlrpc zip
## set up Redis support for php
#RUN docker-php-source extract \
# && curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \
# && tar xfz /tmp/redis.tar.gz \
# && rm -r /tmp/redis.tar.gz \
# && mv phpredis-$PHPREDIS_VERSION /usr/src/php/ext/redis \
# && docker-php-ext-install redis \
# && docker-php-source delete \
# && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
# && chmod +x wp-cli.phar \
# && mv wp-cli.phar /usr/local/bin/wp
# install GD
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
......@@ -42,7 +30,7 @@ RUN apt-get update && apt-get install -y \
RUN apt-get install -y \
libyaml-dev unzip
RUN pecl install yaml-2.0.0
RUN docker-php-ext-enable yaml-2.0.0
RUN docker-php-ext-enable yaml
RUN pecl install apcu
RUN docker-php-ext-enable apcu
......
......@@ -3,9 +3,21 @@ version: "2"
services:
app:
image: kiwilightweight/grav
ports:
- 127.0.0.1:9002:9000
# ports:
# - 127.0.0.1:9002:9000
volumes:
- /home/dave/Projects/grav/test:/var/www/html
# - /home/dave/Projects/grav/test:/var/www/html
- /home/dave/Projects/grav/new:/var/www/html
restart:
unless-stopped
nginx:
image: oeru/nginx-jessie
links:
- app
ports:
- "127.0.0.1:8080:80"
volumes:
- ./nginx:/etc/nginx/conf.d
- ./nginx/cache:/var/cache/nginx
- /home/dave/Projects/grav/new:/var/www/html
restart: unless-stopped
#
# Set YOUR_DOMAIN, YOUR_WPMS_DIR, and YOUR_PORT below to make this work
#
server {
# add [IP-Address:]80 in the next line if you want to limit this to a single interface
listen 80;
index index.html index.php;
## Web root and Domain Name
root /home/dave/Projects/grav/test;
server_name grav.local;
## Begin - Index
# for subfolders, simply adjust the rewrite:
# to use `/subfolder/index.php`
location / {
try_files $uri $uri/ /index.php?$query_string;
}
## End - Index
root /var/www/html;
index index.php;
## Begin - PHP-FPM Configuration
location ~ \.php$ {
# Choose either a socket or TCP/IP address
fastcgi_pass 127.0.0.1:9002;
# change the file name of these logs to include your server name
# if hosting many services...
access_log /var/log/nginx/grav.local_access.log;
error_log /var/log/nginx/grav.local_error.log;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Conection "upgrade";
proxy_set_header Host $http_host;
}
## End - PHP
## Begin - Security
# deny all direct access for these folders
location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; }
# deny running scripts inside core system folders
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny running scripts inside user folder
location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny access to specific files in the root folder
location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; }
## End - Security
}
}
server {
listen 80;
index index.html index.php;
## Web root and Domain Name
root /var/www/html;
server_name default;
## Begin - Index
# for subfolders, simply adjust the rewrite:
# to use `/subfolder/index.php`
location / {
try_files $uri $uri/ /index.php?$query_string;
}
## End - Index
## Begin - PHP-FPM Configuration
location ~ \.php$ {
# Choose either a socket or TCP/IP address
fastcgi_pass app:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
## End - PHP
## Begin - Security
# deny all direct access for these folders
location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; }
# deny running scripts inside core system folders
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny running scripts inside user folder
location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny access to specific files in the root folder
location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; }
## End - Security
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment