}
which php > /dev/null || return 0
-function php_check() { php --define error_reporting=22519 --define display_errors=1 --define log_errors=1 --define html_errors=0 $@; }
+php_check() {
+ php --define error_reporting=22519 --define display_errors=1 --define log_errors=1 --define html_errors=0 $@;
+}
-function php_run() {
+php_run() {
local code="$1"; shift
php -f $NB_ROOT/lib/php/db.php -r "require '$NB_ROOT/lib/php/page.php';$code;" $@
}
-FROM nginx:latest
+FROM nginx:alpine
ARG WWW_ROOT
ENV WWW_ROOT=${WWW_ROOT:-/var/www/html}
RUN mkdir -p $WWW_ROOT && echo '<html><head><title>Welcom to Nginx</title></head><body><h1>Welcom to Nginx</h1></body></html>' > $WWW_ROOT/index.html
# Run daemon
-CMD nginx -g 'daemon off;'
+CMD nginx -g 'daemon off; error_log /dev/stdout info;'
+++ /dev/null
-html {
- font: 100% 'Trebuchet MS', sans-serif;
-}
-
-body {
- display: table;
- margin-left: auto;
- margin-right: auto;
- padding-left: 1em;
- padding-right: 1em;
- background-color: #E6E6E6;
-}
-
-h1 {
- margin: 0 0 0.2em 0;
-}
-
-a,
-body {
- color: #333333;
-}
-
-ul {
- padding: 0;
- margin: 0;
-}
-
-li {
- list-style:none;
- padding: 0 0 0 0.3em;
-}
-
-a, a:visited {
- text-decoration: none;
-}
-
-table { border-collapse: collapse; }
-td, th { padding: 0.2em 0.7em; }
-th { font-size: 0.8em; }
-
-textarea,
-select,
-input:not([type]),
-input[type='text']
-input[type='password']
-input[type='date']
-input[type='email']
-input[type='url']
-input[type=''], {
- box-shadow: 0 0 5px 0 #eee;
- border-radius: 4px;
- border: solid 1px #eee;
-}
-
-form label:after { content: ':'; }
-
-form label,
-form input,
-form select {
- vertical-align: middle;
- margin: 0.2em 0.4em 0.2em 0;
-}
-
-table.rows,
-div.rows,
-.menu,
-object, iframe, pre
-{
- border-collapse: separate;
- border-spacing: 0;
- border-radius: 4px;
- border: solid 1px #fff;
-
- padding: 0.5em 0.2em;
- margin-bottom: 0.5em;
-
-}
-
-table.rows th, table.rows td, table.border th, table.border td { border-bottom: solid 1px #fff; }
-table.rows tr:last-child td, table.border tr:last-child td { border-bottom: none; }
-
-.menu, .nav, .rows,
-.center {
- margin-left: auto;
- margin-right: auto;
- display: table;
-}
-
-.menu { padding: 0.5em; }
-
-.button {
- display: inline-block;
- text-decoration: none;
- line-height: 1.5em;
- margin: 0;
- cursor: pointer;
- border-width: 1px;
- border-style: solid;
- white-space: nowrap;
- box-sizing: border-box;
- color: #ddd;
- background-color: #3C3C3B;
- border-color: #3C3C3B;
- border-radius: 4px;
-}
-
-a:hover,
-.button:hover {
- opacity: 0.8;
-}
-
-/*
-form a.button:visited, form a.button {
- display: inline-block;
- position: relative;
- top: -1px;
-}
-*/
NB_ROOT: /opt/nb
volumes:
- ./../..:$NB_ROOT
- - ./:/var/www/html
- - php
- #- ./../../lib/php/db:/var/www/html
- command: "echo . $NB_ROOT/etc/profile > /etc/profile.d/nb.sh"
-
-# NB 29.11.16 php:
-# NB 29.11.16 build: ../Docker/php/
-# NB 29.11.16 expose:
-# NB 29.11.16 - 9000
-# NB 29.11.16 volumes_from:
-# NB 29.11.16 - code
+ - /etc/profile.d
+ entrypoint: sh -c "echo . $NB_ROOT/etc/profile > /etc/profile.d/nb.sh && /usr/local/sbin/php-fpm"
+ #entrypoint: "/usr/local/sbin/php-fpm"
nginx:
build:
context: ../Docker/nginx/
args:
- - WWW_ROOT=$NB_ROOT/www/dbq
+ - WWW_ROOT=$NB_ROOT/www/dbq/html
volumes_from:
- php
links:
#access_log off;
#error_log /var/log/nginx/error.log error;
- error_log /dev/stderr error;
- access_log /dev/stdout main;
+ #error_log /dev/stderr error;
+ #access_log /dev/stdout main;
sendfile off;
client_max_body_size 100m;
+++ /dev/null
-<?php
-require_once($_SERVER['DOCUMENT_ROOT'].'/../../lib/php/page.php');
-Page::pdef('action','ls');
-require_once($_SERVER['DOCUMENT_ROOT'].'/../../lib/php/db/page.php');
-?>