| @@ -0,0 +1,15 @@ | |||||
| <VirtualHost *:80> | |||||
| ServerName ${APACHE_SERVER_NAME} | |||||
| DocumentRoot ${APACHE_DOCUMENT_ROOT} | |||||
| RewriteEngine On | |||||
| RewriteCond %{HTTPS} off | |||||
| RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] | |||||
| </VirtualHost> | |||||
| <VirtualHost *:443> | |||||
| ServerName ${APACHE_SERVER_NAME} | |||||
| DocumentRoot ${APACHE_DOCUMENT_ROOT} | |||||
| SSLEngine on | |||||
| SSLCertificateFile /etc/ssl/certs/mycert.crt | |||||
| SSLCertificateKeyFile /etc/ssl/private/mycert.key | |||||
| </VirtualHost> | |||||
| @@ -1,2 +1,3 @@ | |||||
| /.db/ | /.db/ | ||||
| /.idea/ | |||||
| /.idea/ | |||||
| /cert/ | |||||
| @@ -2,6 +2,7 @@ FROM php:8.1-apache | |||||
| ENV COMPOSER_MEMORY_LIMIT -1 | ENV COMPOSER_MEMORY_LIMIT -1 | ||||
| ENV APACHE_DOCUMENT_ROOT /var/www/html/contao/public | ENV APACHE_DOCUMENT_ROOT /var/www/html/contao/public | ||||
| ENV APACHE_SERVER_NAME localhost | |||||
| WORKDIR /var/www/html | WORKDIR /var/www/html | ||||
| RUN apt-get update | RUN apt-get update | ||||
| @@ -27,10 +28,6 @@ RUN pecl install xdebug \ | |||||
| && echo 'xdebug.discover_client_host=1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | && echo 'xdebug.discover_client_host=1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | ||||
| && echo 'xdebug.log=/var/www/var/log/xdebug.log' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | && echo 'xdebug.log=/var/www/var/log/xdebug.log' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | ||||
| && echo 'xdebug.log_level=0' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | && echo 'xdebug.log_level=0' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini | ||||
| # && echo 'xdebug.client_port=9003' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | |||||
| # && echo "error_reporting = E_ALL" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | |||||
| # && echo "display_startup_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | |||||
| # && echo "display_errors = On" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ | |||||
| COPY .docker/contao/install_composer.sh /install_composer.sh | COPY .docker/contao/install_composer.sh /install_composer.sh | ||||
| @@ -40,11 +37,22 @@ RUN chmod +x /install_composer.sh \ | |||||
| && rm /install_composer.sh \ | && rm /install_composer.sh \ | ||||
| && mv /composer.phar /usr/local/bin/composer | && mv /composer.phar /usr/local/bin/composer | ||||
| #RUN a2enmod rewrite && a2enmod ssl && a2enmod socache_shmcb | |||||
| RUN a2enmod rewrite && a2enmod ssl | |||||
| COPY ./.docker/contao/httpd.conf /etc/apache2/sites-available/httpd.conf | |||||
| COPY ./.docker/contao/httpd.conf /etc/apache2/conf-available/httpd.conf | |||||
| RUN a2enmod rewrite | |||||
| COPY ./cert/mycert.crt /etc/ssl/certs/mycert.crt | |||||
| COPY ./cert/mycert.key /etc/ssl/private/mycert.key | |||||
| RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf | 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 sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf | ||||
| #RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/httpd.conf | |||||
| #RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/httpd.conf | |||||
| #RUN sed -i '/SSLCertificateFile.*snakeoil\.pem/c\SSLCertificateFile \/etc\/ssl\/certs\/mycert.crt' /etc/apache2/sites-available/httpd.conf | |||||
| #RUN sed -i '/SSLCertificateKeyFile.*snakeoil\.key/cSSLCertificateKeyFile /etc/ssl/private/mycert.key\' /etc/apache2/sites-available/httpd.conf | |||||
| RUN a2ensite httpd | |||||
| RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" | RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" | ||||
| @@ -76,6 +76,7 @@ | |||||
| - `docker container rm $(docker container ls -aq)` | - `docker container rm $(docker container ls -aq)` | ||||
| - `docker exec b768b668cb75 cat contao/composer.json` | - `docker exec b768b668cb75 cat contao/composer.json` | ||||
| - `docker rmi $(docker images -q)` | - `docker rmi $(docker images -q)` | ||||
| - `docker stop contao && docker rm contao && docker rmi php-apache-contao && docker-compose up -d` | |||||
| # Clean restart of Docker instance | # Clean restart of Docker instance | ||||
| 1. Stop the container(s) using the following command: `docker-compose down` | 1. Stop the container(s) using the following command: `docker-compose down` | ||||
| @@ -1,3 +1,4 @@ | |||||
| # Configuration | # Configuration | ||||
| /config/parameters.yml | /config/parameters.yml | ||||
| @@ -9,14 +10,13 @@ | |||||
| # Generated folders | # Generated folders | ||||
| /assets/ | /assets/ | ||||
| #/files/ | |||||
| /public/* | |||||
| !/public/contao-manager.phar.php | |||||
| /files/ | |||||
| /public/ | |||||
| /system/* | /system/* | ||||
| !/system/config/ | !/system/config/ | ||||
| /system/config/localconfig.php | /system/config/localconfig.php | ||||
| /system/config/tcpdf.php | /system/config/tcpdf.php | ||||
| #/templates/ | |||||
| /templates/ | |||||
| /var/ | /var/ | ||||
| /web/ | /web/ | ||||
| @@ -1,37 +1,40 @@ | |||||
| { | { | ||||
| "name": "contao/managed-edition", | |||||
| "description": "Contao Managed Edition", | |||||
| "license": "LGPL-3.0-or-later", | |||||
| "type": "project", | |||||
| "require": { | |||||
| "contao/calendar-bundle": "^4.13", | |||||
| "contao/conflicts": "*@dev", | |||||
| "contao/faq-bundle": "^4.13", | |||||
| "contao/listing-bundle": "^4.13", | |||||
| "contao/manager-bundle": "4.13.*", | |||||
| "contao/news-bundle": "^4.13", | |||||
| "terminal42/contao-node": "^1.5" | |||||
| }, | |||||
| "conflict": { | |||||
| "contao-components/installer": "<1.3" | |||||
| }, | |||||
| "config": { | |||||
| "allow-plugins": { | |||||
| "composer/package-versions-deprecated": true, | |||||
| "contao-community-alliance/composer-plugin": true, | |||||
| "contao-components/installer": true, | |||||
| "contao/manager-plugin": true | |||||
| } | |||||
| }, | |||||
| "extra": { | |||||
| "contao-component-dir": "assets" | |||||
| }, | |||||
| "scripts": { | |||||
| "post-install-cmd": [ | |||||
| "@php vendor/bin/contao-setup" | |||||
| ], | |||||
| "post-update-cmd": [ | |||||
| "@php vendor/bin/contao-setup" | |||||
| ] | |||||
| "name": "contao/managed-edition", | |||||
| "description": "Contao Managed Edition", | |||||
| "license": "LGPL-3.0-or-later", | |||||
| "type": "project", | |||||
| "require": { | |||||
| "contao/calendar-bundle": "^5.0", | |||||
| "contao/comments-bundle": "^5.0", | |||||
| "contao/conflicts": "@dev", | |||||
| "contao/faq-bundle": "^5.0", | |||||
| "contao/listing-bundle": "^5.0", | |||||
| "contao/manager-bundle": "5.0.*", | |||||
| "contao/news-bundle": "^5.0", | |||||
| "contao/newsletter-bundle": "^5.0" | |||||
| }, | |||||
| "conflict": { | |||||
| "contao-components/installer": "<1.3" | |||||
| }, | |||||
| "minimum-stability": "dev", | |||||
| "prefer-stable": true, | |||||
| "config": { | |||||
| "allow-plugins": { | |||||
| "composer/package-versions-deprecated": true, | |||||
| "contao-community-alliance/composer-plugin": true, | |||||
| "contao-components/installer": true, | |||||
| "contao/manager-plugin": true | |||||
| } | } | ||||
| } | |||||
| }, | |||||
| "extra": { | |||||
| "contao-component-dir": "assets" | |||||
| }, | |||||
| "scripts": { | |||||
| "post-install-cmd": [ | |||||
| "@php vendor/bin/contao-setup" | |||||
| ], | |||||
| "post-update-cmd": [ | |||||
| "@php vendor/bin/contao-setup" | |||||
| ] | |||||
| } | |||||
| } | |||||
| @@ -1,4 +1,4 @@ | |||||
| version: '3.1' | |||||
| version: '3.7' | |||||
| services: | services: | ||||
| database: | database: | ||||
| @@ -7,21 +7,25 @@ services: | |||||
| ports: | ports: | ||||
| - "3307:3306" | - "3307:3306" | ||||
| environment: | environment: | ||||
| # think about .env file here | |||||
| MYSQL_ROOT_PASSWORD: root | MYSQL_ROOT_PASSWORD: root | ||||
| volumes: | volumes: | ||||
| - ./.db:/var/lib/mysql | - ./.db:/var/lib/mysql | ||||
| restart: always | |||||
| networks: | networks: | ||||
| - default | - default | ||||
| contao: | contao: | ||||
| build: | build: | ||||
| context: ./ | context: ./ | ||||
| dockerfile: Dockerfile | dockerfile: Dockerfile | ||||
| image: php-apache-contao | |||||
| image: 'php-apache-contao' | |||||
| container_name: contao | container_name: contao | ||||
| ports: | ports: | ||||
| - "89:80" | |||||
| - "443:443" | |||||
| - '8089:80' | |||||
| - '8090:443' | |||||
| volumes: | volumes: | ||||
| - ./cert/mycert.crt:/etc/ssl/certs/mycert.crt | |||||
| - ./cert/mycert.key:/etc/ssl/private/mycert.key | |||||
| - ./app:/var/www/html | - ./app:/var/www/html | ||||
| networks: | networks: | ||||
| - default | - default | ||||