Skip to content

Commit

Permalink
Merge branch 'master' into composer
Browse files Browse the repository at this point in the history
* master:
  Raised docker-compose version to 3
  Set error_reporting to E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT
  Readme: Set correct links to it
  Nginx: Deny all hidden files that starts with a '.'
  First docker environment is ready and runnable
  Remove the set of "error_reporting"
  Removed mysql_ functionality in favor of mysqli
  Fixed constructor names for PHP7 while calling installation
  • Loading branch information
andygrunwald committed Jun 9, 2017
2 parents 3461f92 + e373be9 commit 6792ecf
Show file tree
Hide file tree
Showing 9 changed files with 178 additions and 249 deletions.
25 changes: 25 additions & 0 deletions .docker/nginx-development.conf
@@ -0,0 +1,25 @@
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;

# Deny all hidden files that starts with a '.'
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
5 changes: 5 additions & 0 deletions .docker/nginx-php-flags.conf
@@ -0,0 +1,5 @@
catch_workers_output = yes

php_admin_flag[log_errors] = on
php_flag[display_errors] = on
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_DEPRECATED
12 changes: 12 additions & 0 deletions Dockerfile
@@ -0,0 +1,12 @@
FROM php:7.0-fpm

# Install PHP-Extensions that are not provided by the base image
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libsnmp-dev \
snmp \
&& docker-php-ext-install -j$(nproc) mysqli snmp \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd
44 changes: 43 additions & 1 deletion README.md
Expand Up @@ -41,7 +41,49 @@ Sollten Onlinehilfe und Helpletts nicht weiterhelfen, kann der Anwender im Wiki

## Requirements

* PHP 7
* PHP 7 (with mysqli, snmp and gd extensions)

## Installation

### Docker

We assume that you have a running [Docker Community Edition](https://www.docker.com/community-edition) installed.

```
$ git clone https://github.com/lansuite/lansuite.git
$ cd lansuite
$ touch ./inc/base/config.php
$ # Add the content of the example configuration file below into ./inc/base/config.php
$ chmod 0777 ./inc/base/config.php
$ chmod -R 0777 ./ext_inc/
$ docker-compose up
```

This will start a [Nginx webserver](https://nginx.org/) with a [php-fpm](https://secure.php.net/manual/en/install.fpm.php) configuration and a [MySQL database](https://www.mysql.com/) for you.
After everythign started you should be able to visit http://<Your-Docker-IP>:8080/ and see a running LanSuite-System.

### Example configuration file

An example configuration file:

```ini
[lansuite]
version=Nightly
default_design=simple
chmod_dir=777
chmod_file=666
debugmode=0

[database]
server=mysql
user=root
passwd=
database=lansuite
prefix=ls_
charset=utf8
```

**Warning**: Setting directories to 0777 is not suggested for production. Only your webserver user should be able to write into this directory.

## Development

Expand Down
30 changes: 30 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,30 @@
version: '3'

services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- .:/code
- ./.docker/nginx-development.conf:/etc/nginx/conf.d/default.conf
networks:
- code-network
php:
image: lansuite/lansuite:latest
volumes:
- .:/code
- ./.docker/nginx-php-flags.conf:/usr/local/etc/php-fpm.d/php-flags.conf
networks:
- code-network
mysql:
image: mysql:5.5
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE="lansuite"
networks:
- code-network

networks:
code-network:
driver: bridge

0 comments on commit 6792ecf

Please sign in to comment.