diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..72980e5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM php:7.2-apache + +ENV APACHE_DOCUMENT_ROOT /srv/www/christianflatshare.org +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 apt-get update && \ + apt-get install -y \ + zlib1g-dev\ + libxml2-dev + +RUN docker-php-ext-install mysqli mbstring zip xml pdo_mysql + +COPY . /srv/www/christianflatshare.org + +VOLUME [ "/srv/www/christianflatshare.org" ] + +RUN chown -R www-data:www-data /srv/www/christianflatshare.org + +EXPOSE 80 diff --git a/README.md b/README.md index f4eb16d..541cdf9 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,20 @@ CFS has been open sourced under the GPLv3 to allow paritpation from the technica There is a list of projects maintained in [Github](https://github.com/ChristianFlatshare/ChristianFlatshare/projects "CFS projects") +## Run with Docker +The simplest way to run and edit this project is using [docker]('https://www.docker.com/') + +With docker installed, all you have to do is run `docker-compose up`. + +The site will be served on localhost port 80 + +Any changes to the files should show up instantly! (as long as you remember to save them!) ## Installation ### 1. Add the document root to your Apache2 config: VirtualHost ServerName christianflatshare.org + Document root /srv/www/christianflatshare.org diff --git a/cache/templates/13/94/71877fd64564fa40efbd66290d06.php b/cache/templates/13/94/71877fd64564fa40efbd66290d06.php new file mode 100644 index 0000000..c54e96b --- /dev/null +++ b/cache/templates/13/94/71877fd64564fa40efbd66290d06.php @@ -0,0 +1,68 @@ +parent = false; + + $this->blocks = array( + ); + } + + protected function doDisplay(array $context, array $blocks = array()) + { + // line 1 + echo "
+
+ env, twig_upper_filter($this->env, $this->getAttribute((isset($context["country"]) ? $context["country"] : null), "iso")), "html", null, true); + echo ".png\" class=\"mid-flag\" /> +

"; + // line 4 + echo twig_escape_filter($this->env, $this->getAttribute((isset($context["country"]) ? $context["country"] : null), "name"), "html", null, true); + echo "

+

Change

+
+
+
Post an Advert
+
+
+ \t
+ \t
+ \t

Member Login

+ "; + // line 14 + echo (isset($context["loginForm"]) ? $context["loginForm"] : null); + echo " + env, (isset($context["FacebookLoginURL"]) ? $context["FacebookLoginURL"] : null), "html", null, true); + echo "\" class=\"fb-login\">Login with Facebook + \t
+ \t
+
+

+
+

Christian Flatshare is free to join and to use.

"; + } + + public function getTemplateName() + { + return "loginOrRegister.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 44 => 15, 40 => 14, 23 => 3, 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,); + } +} diff --git a/cache/templates/42/bd/703cf8c7800a9e8768fc09381eca.php b/cache/templates/42/bd/703cf8c7800a9e8768fc09381eca.php new file mode 100644 index 0000000..b1dbf95 --- /dev/null +++ b/cache/templates/42/bd/703cf8c7800a9e8768fc09381eca.php @@ -0,0 +1,103 @@ +parent = false; + + $this->blocks = array( + ); + } + + protected function doDisplay(array $context, array $blocks = array()) + { + // line 1 + echo "
+\t
env, (isset($context["homeURL"]) ? $context["homeURL"] : null), "html", null, true); + echo "\">\"Christian
+\t
+\t\tenv, (isset($context["homeURL"]) ? $context["homeURL"] : null), "html", null, true); + echo "\"> +\t\t\t +\t\t\t +\t\t\t
Home page
+\t\t
+\t\t +\t\t\t +\t\t\t +\t\t\t
Countries
+\t\t
+\t\t +\t\t\t +\t\t\t +\t\t\t
Contact us
+\t\t
+ "; + // line 19 + if (((isset($context["loggedIn"]) ? $context["loggedIn"] : null) == false)) { + // line 20 + echo " \t\t + \t\t\t + \t\t\t + \t\t\t
Register / Login
+ \t\t
+ "; + } else { + // line 26 + echo " \t\t + \t\t\t + \t\t\t + \t\t\t
Your ads
+ \t\t
+\t "; + } + // line 32 + echo "\t
\t\t\t\t\t\t\t\t\t +
+\t\t +
+\t +
"; + } + + public function getTemplateName() + { + return "header.twig"; + } + + public function isTraitable() + { + return false; + } + + public function getDebugInfo() + { + return array ( 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,); + } +} diff --git a/cache/templates/fe/68/3c163cf0b5ec38cfae8100cb5885.php b/cache/templates/fe/68/3c163cf0b5ec38cfae8100cb5885.php new file mode 100644 index 0000000..77e62ba --- /dev/null +++ b/cache/templates/fe/68/3c163cf0b5ec38cfae8100cb5885.php @@ -0,0 +1,33 @@ +parent = false; + + $this->blocks = array( + ); + } + + protected function doDisplay(array $context, array $blocks = array()) + { + // line 1 + echo "
+
+
"; + } + + public function getTemplateName() + { + return "superheader.twig"; + } + + public function getDebugInfo() + { + return array ( 84 => 46, 80 => 44, 76 => 42, 74 => 41, 63 => 32, 55 => 26, 47 => 20, 45 => 19, 27 => 4, 22 => 2, 19 => 1,); + } +} diff --git a/database/Dockerfile b/database/Dockerfile new file mode 100644 index 0000000..b1ec14e --- /dev/null +++ b/database/Dockerfile @@ -0,0 +1,6 @@ +FROM mysql:5.6 + +COPY . . +RUN zcat ./db_user.sql.gz > /docker-entrypoint-initdb.d/db_user.sql + +EXPOSE 3306 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6bb82ca --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: '2' +services: + php: + build: + dockerfile: 'Dockerfile' + context: '.' + volumes: + - .:/srv/www/christianflatshare.org + ports: + - '80:80' + depends_on: + - db + environment: + DB_NAME: cfs + DB_USER_NAME: db_user + DB_PASSWORD: account_password + DB_HOST: db + + db: + build: + dockerfile: 'Dockerfile' + context: 'database' + environment: + MYSQL_ROOT_PASSWORD: pwd + MYSQL_DATABASE: cfs + MYSQL_USER: db_user + MYSQL_PASSWORD: account_password + ports: + - '3306:3306' diff --git a/includes/configuration.php b/includes/configuration.php index 4161e69..e0a006e 100644 --- a/includes/configuration.php +++ b/includes/configuration.php @@ -12,10 +12,10 @@ define ('SERVER_ENVIRONMENT', 'PRODUCTION'); // DB constants -define('DB_HOST','localhost'); -define('DB_USER_NAME','db_user'); -define('DB_PASSWORD','account_password'); -define('DB_NAME','cfs'); +define('DB_HOST', $_ENV["DB_HOST"]); +define('DB_USER_NAME',$_ENV["DB_USER_NAME"]); +define('DB_PASSWORD',$_ENV["DB_PASSWORD"]); +define('DB_NAME',$_ENV["DB_NAME"]); // SITE contants define('SITE','www.christianflatshare.org/');