FEATURE: Added Docker support

This commit is contained in:
nikurasu 2022-01-01 17:42:49 +01:00
parent 35a3953378
commit 1151d30f75
6 changed files with 238 additions and 207 deletions

0
.dockerignore Normal file
View file

View file

@ -0,0 +1,6 @@
version: "3.0"
services:
web:
image: httpd:alpine
volumes:
-

View file

@ -0,0 +1,29 @@
FROM php:8.1-apache as BASE
MAINTAINER Nikurasu <publicmai@nikurasu.de>
WORKDIR /var/www/html
# set env
ENV TZ Europe/Berlin
ENV APACHE_PHP_MEMORY_LIMIT 500M
ENV APACHE_DOCUMENT_ROOT /var/www/html/src/public
# install updates, apache2 and php-extensions
RUN apt-get update -y &&\
apt-get upgrade -y &&\
apt-get install -y libonig-dev
RUN docker-php-ext-install bcmath
# configure apache2
RUN sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf
RUN sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
RUN a2enmod -q rewrite actions
# copy source files
COPY src/ /var/www/html/src
RUN chown -R www-data:www-data /var/www
# modify .env file
RUN sed -ri -e "s/^DB_DATABASE=.*$/DB_DATABASE=\/var\/www\/html\/src\/resources\/database.db/" /var/www/html/src/.env
RUN sed -ri -e "s/^JSON_FILE_PATH=.*$/JSON_FILE_PATH=\/var\/www\/html\/src\/resources\/data.json/" /var/www/html/src/.env
EXPOSE 80
CMD php src/artisan preloadDB:all && sapachectl -D FOREGROUND

View file

@ -3,10 +3,7 @@
namespace App\Http\Controllers;
use App\Services\Links\LinksService;
use App\Services\LoadDBService;
use App\Services\SocialTreePageService;
use App\Services\Userdatas\UserdatasService;
use Illuminate\Http\Request;
use Illuminate\View\View;
class SocialTreePageController extends Controller
@ -16,7 +13,6 @@ class SocialTreePageController extends Controller
public function __construct()
{
$this->socialTreePageService = new SocialTreePageService();
$this->linksService = new LinksService();
$this->userdatasService = new UserdatasService();
}

View file

@ -57,7 +57,12 @@
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"laravel/*": true,
"php/*": true,
"symfony": true
}
},
"minimum-stability": "dev",
"prefer-stable": true

399
src/composer.lock generated

File diff suppressed because it is too large Load diff