commit a072419989331d1ddf682c80a82b01e2b8b87902 Author: Martin Date: Sat Nov 8 17:39:11 2025 +0100 init diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..503c4aa --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Database Configuration +DB_HOST=db +DB_PORT=3306 +DB_DATABASE=immorechner +DB_USERNAME=immorechner_user +DB_PASSWORD=immorechner_pass +DB_ROOT_PASSWORD=root + +# Application Configuration +APP_ENV=local +APP_DEBUG=true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89b642b --- /dev/null +++ b/.gitignore @@ -0,0 +1,71 @@ +# IntelliJ IDEA / PhpStorm +.idea/ +*.iml +*.ipr +*.iws +.idea_modules/ +out/ + +# Composer +/vendor/ +composer.lock +composer.phar + +# PHP +*.log +*.cache +.phpunit.result.cache +php_errors.log + +# Environment files +.env +.env.local +.env.*.local + +# OS files +.DS_Store +Thumbs.db +desktop.ini + +# Temporary files +*.tmp +*.temp +*.swp +*.swo +*~ + +# Build artifacts +/build/ +/dist/ + +# Cache directories +/cache/ +/tmp/ +/temp/ + +# Backup files +*.bak +*.backup +*.old + +# Node modules (falls Frontend-Tools verwendet werden) +node_modules/ +npm-debug.log +yarn-error.log + +# PHPUnit +/phpunit.xml +/.phpunit.cache + +# Coverage reports +/coverage/ +*.coverage +clover.xml + +# Deployment files +/deploy/ +*.deploy + +# Docker +docker-compose.override.yml +.dockerignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e692bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM php:8.3-apache + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + git \ + curl \ + libpng-dev \ + libonig-dev \ + libxml2-dev \ + zip \ + unzip \ + libzip-dev \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install PHP extensions +RUN docker-php-ext-install pdo_mysql mysqli mbstring exif pcntl bcmath gd zip + +# Enable Apache mod_rewrite +RUN a2enmod rewrite + +# Enable Apache headers module +RUN a2enmod headers + +# Copy custom Apache configuration +COPY ./docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf + +# Install Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Set working directory +WORKDIR /var/www/html + +# Change ownership +RUN chown -R www-data:www-data /var/www/html + +# Expose port 80 +EXPOSE 80 + +# Start Apache +CMD ["apache2-foreground"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0a04104 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,57 @@ +version: '3.8' + +services: + web: + build: + context: . + dockerfile: Dockerfile + container_name: immorechner_web + ports: + - "8080:80" + volumes: + - .:/var/www/html + environment: + - APACHE_DOCUMENT_ROOT=/var/www/html + depends_on: + - db + networks: + - immorechner_network + + db: + image: mariadb:latest + container_name: immorechner_db + restart: always + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: immorechner + MYSQL_USER: immorechner_user + MYSQL_PASSWORD: immorechner_pass + ports: + - "3306:3306" + volumes: + - db_data:/var/lib/mysql + networks: + - immorechner_network + + phpmyadmin: + image: phpmyadmin:latest + container_name: immorechner_phpmyadmin + restart: always + ports: + - "8081:80" + environment: + PMA_HOST: db + PMA_PORT: 3306 + PMA_USER: root + PMA_PASSWORD: root + depends_on: + - db + networks: + - immorechner_network + +volumes: + db_data: + +networks: + immorechner_network: + driver: bridge diff --git a/docker/apache/000-default.conf b/docker/apache/000-default.conf new file mode 100644 index 0000000..501b02a --- /dev/null +++ b/docker/apache/000-default.conf @@ -0,0 +1,22 @@ + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + + # Enable mod_rewrite + RewriteEngine On + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # Optional: Disable directory listing + + Options -Indexes +FollowSymLinks + + +