better example project
This commit is contained in:
parent
bf0fb911fd
commit
772c22a49a
5 changed files with 94 additions and 5 deletions
24
example/hello-world.project/conf/html/index.html
Normal file
24
example/hello-world.project/conf/html/index.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Hello kiwi #2!</title>
|
||||
<style>
|
||||
body {
|
||||
width: 50em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Another Hello World!</h1>
|
||||
|
||||
<p>This service uses an off-the-shelf image and the conf-directory feature of kiwi-config.</p>
|
||||
|
||||
<p><em>Greetings, nginx.</em></p>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1 +0,0 @@
|
|||
This is a test.
|
|
@ -10,13 +10,46 @@ networks:
|
|||
name: ${KIWI_HUB_NAME}
|
||||
|
||||
services:
|
||||
hello-world:
|
||||
# simple loop producing (rather boring) logs
|
||||
greeter:
|
||||
image: alpine:latest
|
||||
command: sh -c 'LOOP=1; while :; do echo Hello World "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 10; done'
|
||||
|
||||
# basic webserver listening on localhost:8080
|
||||
web:
|
||||
build: web
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
|
||||
# internal mariadb (mysql) instance with persistent storage
|
||||
db:
|
||||
image: mariadb:10
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- kiwi_hub
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: changeme
|
||||
volumes:
|
||||
- "${TARGETDIR}/db:/var/lib/mysql"
|
||||
|
||||
# admin interface for databases
|
||||
adminer:
|
||||
image: adminer:standalone
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- default
|
||||
- kiwi_hub
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
foo-bar:
|
||||
image: alpine:latest
|
||||
command: sh -c 'LOOP=1; while :; do echo Foo Bar "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 20; done'
|
||||
# Another webserver just to show off the ${CONFDIR} variable
|
||||
another-web:
|
||||
image: nginx:stable-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8082:80"
|
||||
volumes:
|
||||
- "${CONFDIR}/html/index.html:/usr/share/nginx/html/index.html:ro"
|
||||
|
|
2
example/hello-world.project/web/Dockerfile
Normal file
2
example/hello-world.project/web/Dockerfile
Normal file
|
@ -0,0 +1,2 @@
|
|||
FROM nginx:stable-alpine
|
||||
COPY index.html /usr/share/nginx/html
|
31
example/hello-world.project/web/index.html
Normal file
31
example/hello-world.project/web/index.html
Normal file
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Hello kiwi!</title>
|
||||
<style>
|
||||
body {
|
||||
width: 50em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
<h2>kiwi-config works.</h2>
|
||||
|
||||
<p>This is an example service on a custom image assembled by kiwi-config.<br /> But wait, there's more!</p>
|
||||
|
||||
<a href="//localhost:8081"><h3>Adminer</h3></a>
|
||||
<p>There's a mySQL database included in this project. Login with user <q>root</q> and password <q>changeme</q>.</p>
|
||||
|
||||
<a href="//localhost:8082"><h3>Another hello world</h3></a>
|
||||
<p>Another web server, built in a different way.</p>
|
||||
|
||||
<p><em>Greetings, nginx.</em></p>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue