Permalink
Browse files

Load original views from phansible

  • Loading branch information...
eher-werkspot committed Jul 8, 2015
1 parent bfb458b commit 39a865d92b5a2917bfe50d48b550bc6ea9067fc5
View
@@ -2,10 +2,38 @@
require 'vendor/autoload.php';
$twig = new Twig_Environment(new Twig_Loader_Filesystem('views'));
if (!empty($_POST)) {
var_dump($_POST);
$zipFile = tempnam(sys_get_temp_dir(), "phansible_bundle_");
$files['docker-machine.sh'] = $twig->render('docker-machine.sh.twig', $_POST['vagrant_local']);
$files['docker/web/Dockerfiles'] = $twig->render('docker/web.twig', $_POST);
$files['docker/php/Dockerfiles'] = $twig->render('docker/php.twig', $_POST);
$files['docker-compose.yml'] = $twig->render('docker-compose.yml.twig', $_POST);
$zip = new \ZipArchive();
$zip->open($zipFile, \ZipArchive::CREATE);
foreach ($files as $fileName => $content) {
$zip->addFromString($fileName, $content);
}
$zip->close();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"phocker\.zip\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($zipFile));
ob_end_flush();
@readfile($zipFile);
unlink($zipFile);
//var_dump($_POST, $files);
exit;
}
$twig = new Twig_Environment(new Twig_Loader_Filesystem('.'));
echo $twig->render('index.html.twig', [
]);
echo $twig->render('index.html.twig');
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,23 @@
{% if nginx.install %}
php:
build: docker/php
links:
{% if mysql.install %}
- database
{% endif %}
{% endif %}
web:
build: docker/web
{% if mysql.install %}
database:
{% if mysql.install %}
image: mysql
environments:
- MYSQL_ROOT_PASSWORD={{ mysql.root_password }}
- MYSQL_DATABASE={{ mysql.database }}
- MYSQL_USER={{ mysql.user }}
- MYSQL_PASSWORD={{ mysql.password }}
{% endif %}
{% endif %}
@@ -0,0 +1,6 @@
#!/bin/sh
docker-machine create \
--driver virtualbox \
--virtualbox-memory {{ vm.memory|default(1024) }} \
phocker
View
@@ -0,0 +1,11 @@
FROM php:{{ php.ppa|replace({'php5-': ''})|default('latest') }}
# Install modules
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
&& docker-php-ext-install iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd
View
No changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 39a865d

Please sign in to comment.