diff --git a/Readme b/Readme index bc93bb7ec5fc30ae11fc788668e5ddc20fcccbc1..d293a1979d51815ef699c59ddb4e7be6bd72131f 100644 --- a/Readme +++ b/Readme @@ -1 +1,48 @@ -This is a docker image for running [Pretty Noemi CMS]() +This is a docker image for running [Pretty Noemi CMS](https://framagit.org/framasoft/PrettyNoemieCMS) + +## Installation + +```bash +cp .env.sample .env +docker-compose up +ln -s /var/lib/docker/volume/prettynoemie_sites/_data/ sites +``` + +## Add a site + +### by copy + +```bash +cp sites/framsite sites/mysite.fqdn +``` + +### From backup + +```bash +cd sites +unzip mysite.fqdn.zip +``` + +### Set the reverse proxy + +Adapt this file and add it to `/etc/apache2/sites-available/mysite.conf` + +```apache2 +<VirtualHost *:80> + ServerName mysite.fqdn + + #ProxyVia On + #ProxyRequests On + ProxyPreserveHost on + + Header set X-FRAMA-SITE mysite.fqdn + + ProxyPass / http://127.0.0.1:8000/ + ProxyPassReverse / http://127.0.0.1:8000/ + + CustomLog ${APACHE_LOG_DIR}/mysite.tetras-libre.access.log combined + ErrorLog ${APACHE_LOG_DIR}/mysite-libre.error.log +</VirtualHost> +``` + +Finaly run `certbot` to use HTTPS diff --git a/docker-compose.yml b/docker-compose.yml index 85025bdf840e513ab4d779f67a254098ed93189a..5222be696149a73ab6ed02b0d817fbfbd09d9e83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ -version: '2' +version: "3.7" services: front: build: ./docker volumes: - - 'noemie:/var/www/html/PrettyNoemieCMS' + - sites:/var/www/html/sites environment: restart: ${RESTART} PHP_INI_DATE_TIMEZONE: 'Europe/Paris' @@ -14,4 +14,4 @@ services: restart: ${RESTART} volumes: - noemie: + sites: diff --git a/docker/Dockerfile b/docker/Dockerfile index 6f2826492c2534b5364d623a40306224b416fac3..d86b0f8b12c2461a0c823501992676c6f41dd5f9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,16 +14,16 @@ RUN apt-get update && apt-get install -y \ RUN docker-php-ext-install -j$(nproc) gd curl mbstring xml zip COPY install_composer.sh / +COPY noemie.conf /etc/apache2/sites-available/ +RUN a2dissite 000-default.conf +RUN a2ensite noemie.conf RUN /bin/bash /install_composer.sh RUN rm /install_composer.sh -#COPY noemie.conf /etc/apache2/sites-enabled/000-default.conf - +WORKDIR /var/www/ +RUN git clone https://framagit.org/framasoft/PrettyNoemieCMS html WORKDIR /var/www/html -RUN git clone https://framagit.org/framasoft/PrettyNoemieCMS -WORKDIR /var/www/html/PrettyNoemieCMS RUN /usr/local/bin/composer.phar install -RUN chown -R www-data /var/www/html/PrettyNoemieCMS -WORKDIR /var/www/html +RUN chown -R www-data /var/www/html/ RUN a2enmod rewrite diff --git a/docker/noemie.conf b/docker/noemie.conf new file mode 100644 index 0000000000000000000000000000000000000000..90f7199a2f746ee80c78e8c1ecdb213856183924 --- /dev/null +++ b/docker/noemie.conf @@ -0,0 +1,14 @@ +<VirtualHost *:8000> + DocumentRoot /var/www/html + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + <Directory "/var/www/html"> + Options -Indexes +FollowSymLinks +Includes + AllowOverride All + Order allow,deny + Allow from All + </Directory> +</VirtualHost>