Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
docker-grav
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dave Lane
docker-grav
Commits
fbf5ab27
Commit
fbf5ab27
authored
Feb 06, 2018
by
Dave Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working configuration
parent
14ec0f93
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
49 deletions
+73
-49
Dockerfile
Dockerfile
+3
-15
docker-compose.yml
docker-compose.yml
+15
-3
nginx.conf
nginx.conf
+16
-31
nginx/default.conf
nginx/default.conf
+39
-0
No files found.
Dockerfile
View file @
fbf5ab27
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
...
...
docker-compose.yml
View file @
fbf5ab27
...
...
@@ -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
nginx.conf
View file @
fbf5ab27
#
# 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
}
}
nginx/default.conf
0 → 100644
View file @
fbf5ab27
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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment