diff --git a/README.md b/README.md index e69de29..d992cce 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,15 @@ +#h1 Docker Webserver Stack + +Ein Webserver stack basierend auf Docker. + +#h2 Enthaltene Software + +* PHP-FPM 7.4.8 basierend auf Alpine +* Nginx latest basierend auf Alpine +* Mariadb latest basierend auf Alpine + +#h2 Konfiguration + +Zusätzliche PHP-Pakete müssen in dem Dockerfile angegben werden. Nach löschen des Containers wird dieser +beim erneuten erstellen mit den zusätzlichen Paketen gebaut. + diff --git a/docker-compose.yaml b/docker-compose.yaml index f46fed2..f08ada6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,13 +1,11 @@ version: '3.3' services: php: + restart: always build: context: './docker/php' - ports: - - 9000:9000 volumes: - './www-data:/var/www' - - './docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf' - './docker/php/php.ini:/usr/local/etc/php/conf.d/php.override.ini' - './logs/php:/var/log/php' environment: @@ -15,6 +13,7 @@ services: MYSQL_PASSWORD: ${MYSQL_PASSWORD} nginx: + restart: always image: nginx:alpine ports: - 8123:80 @@ -25,7 +24,11 @@ services: depends_on: - php mysql: + restart: always image: mariadb:latest + volumes: + - './docker/mariadb/my.cnf:/etc/mysql/conf.d/db.cnf' + - './logs/mariadb:/var/log/mariadb' depends_on: - php environment: diff --git a/docker/mariadb/my.cnf b/docker/mariadb/my.cnf new file mode 100644 index 0000000..f060b37 --- /dev/null +++ b/docker/mariadb/my.cnf @@ -0,0 +1,9 @@ +[mariadb] + + +# Logging +general_log_file = /var/log/mariadb/mysql.log +general_log = 1 +log_warnings = 2 +log_error = /var/log/mariadb/mariadb_error.log +slow_query_log_file = /var/log/mariadb/mariadb_slow.log \ No newline at end of file diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index f50890f..e7fe420 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,3 +1,3 @@ -FROM php:7.2-fpm +FROM php:7.4.8-fpm-alpine3.12 RUN docker-php-ext-install mysqli \ No newline at end of file diff --git a/docker/php/php.ini b/docker/php/php.ini index bec2a07..717675b 100644 --- a/docker/php/php.ini +++ b/docker/php/php.ini @@ -5,7 +5,8 @@ error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT display_errors=Off max_execution_time=60 memory_limit=256M -error_log = /var/log/php/error.log -access_log = /var/log/php/access.log -post_max_size = 24M -upload_max_filesize = 24M \ No newline at end of file +error_log=/var/log/php/error.log +access_log=/var/log/php/access.log +post_max_size=24M +upload_max_filesize=24M +short_open_tag=On \ No newline at end of file diff --git a/docker/php/www.conf b/docker/php/www.conf deleted file mode 100644 index b9bfd2a..0000000 --- a/docker/php/www.conf +++ /dev/null @@ -1,11 +0,0 @@ -[www] - -user = www-data -group = www-data - -listen = nginx:9000 -pm = dynamic -pm.max_children = 5 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 3 \ No newline at end of file diff --git a/www-data/connect.php b/www-data/connect.php index 5f224d5..1198949 100644 --- a/www-data/connect.php +++ b/www-data/connect.php @@ -1,10 +1,21 @@ + \ No newline at end of file diff --git a/www-data/index.php b/www-data/index.php index f6b0c5b..beb8284 100644 --- a/www-data/index.php +++ b/www-data/index.php @@ -1 +1 @@ -echo 'Welcome!'; \ No newline at end of file +