1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-25 05:53:00 +00:00

better example project

This commit is contained in:
Jörn-Michael Miehe 2020-08-24 14:49:39 +02:00
parent bf0fb911fd
commit 772c22a49a
5 changed files with 94 additions and 5 deletions

View 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>

View file

@ -1 +0,0 @@
This is a test.

View file

@ -10,13 +10,46 @@ networks:
name: ${KIWI_HUB_NAME} name: ${KIWI_HUB_NAME}
services: services:
hello-world: # simple loop producing (rather boring) logs
greeter:
image: alpine:latest image: alpine:latest
command: sh -c 'LOOP=1; while :; do echo Hello World "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 10; done' 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: networks:
- default - default
- kiwi_hub - kiwi_hub
depends_on:
- db
ports:
- "8081:8080"
foo-bar: # Another webserver just to show off the ${CONFDIR} variable
image: alpine:latest another-web:
command: sh -c 'LOOP=1; while :; do echo Foo Bar "$$LOOP"; LOOP=$$(($$LOOP + 1)); sleep 20; done' image: nginx:stable-alpine
restart: unless-stopped
ports:
- "8082:80"
volumes:
- "${CONFDIR}/html/index.html:/usr/share/nginx/html/index.html:ro"

View file

@ -0,0 +1,2 @@
FROM nginx:stable-alpine
COPY index.html /usr/share/nginx/html

View 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>