This repository has been archived by the owner on Jan 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d51de64
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM tutum/apache-php | ||
ADD *.php /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '2' | ||
services: | ||
web: | ||
build: . | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- .:/code | ||
depends_on: | ||
- postgres | ||
postgres: | ||
image: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<html> | ||
<head> | ||
<title>KubeCon keynote demo</title> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700,400italic|Material+Icons" rel="stylesheet"> | ||
<style> | ||
* { font-family: Roboto; } | ||
</style> | ||
</head> | ||
<body> | ||
<?php | ||
$color = "red"; | ||
if($color == "red") { | ||
$hex = "#F44336"; | ||
} else if($color == "green") { | ||
$hex = "#4CAF50"; | ||
} | ||
?> | ||
<span style="background-color: #F44336; color:white;">Hello, world! I am the red version, running in container <?=`hostname`?> in <?=json_decode(file_get_contents("http://freegeoip.net/json"))["country_name"];?>.</span> | ||
<form action="index.php"> | ||
<p>Word: <input type="text"></p> | ||
<input type="submit"> | ||
</form> | ||
<?php | ||
$dbconn = pg_connect("host=postgres dbname=words user=root password=password"); | ||
if(!$dbconn) { | ||
?><p>No database connection.</p><? | ||
} | ||
if($_POST["text"]) { | ||
pg_query("insert into hello (name) values (".pg_escape_literal($_POST["text"]).")"); | ||
} | ||
$result = pg_query("select word from hello"); | ||
?><ul><? | ||
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) { | ||
?><li><?=$line?></li><? | ||
} | ||
?></ul><? | ||
?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
$dbconn = pg_connect("host=pgsql dbname=words user=root password=password"); | ||
pg_query("create table hello (word text)"); |