diff --git a/example/hello-world.project/conf/html/index.html b/example/hello-world.project/conf/html/index.html new file mode 100644 index 0000000..869330c --- /dev/null +++ b/example/hello-world.project/conf/html/index.html @@ -0,0 +1,24 @@ + + + + + + Hello kiwi #2! + + + + +

Another Hello World!

+ +

This service uses an off-the-shelf image and the conf-directory feature of kiwi-config.

+ +

Greetings, nginx.

+ + + \ No newline at end of file diff --git a/example/hello-world.project/conf/test.txt b/example/hello-world.project/conf/test.txt deleted file mode 100644 index 484ba93..0000000 --- a/example/hello-world.project/conf/test.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test. diff --git a/example/hello-world.project/docker-compose.yml b/example/hello-world.project/docker-compose.yml index 35951b8..9a7ea1e 100644 --- a/example/hello-world.project/docker-compose.yml +++ b/example/hello-world.project/docker-compose.yml @@ -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" diff --git a/example/hello-world.project/web/Dockerfile b/example/hello-world.project/web/Dockerfile new file mode 100644 index 0000000..d479ce9 --- /dev/null +++ b/example/hello-world.project/web/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:stable-alpine +COPY index.html /usr/share/nginx/html \ No newline at end of file diff --git a/example/hello-world.project/web/index.html b/example/hello-world.project/web/index.html new file mode 100644 index 0000000..407e6bd --- /dev/null +++ b/example/hello-world.project/web/index.html @@ -0,0 +1,31 @@ + + + + + + Hello kiwi! + + + + +

Hello World!

+

kiwi-config works.

+ +

This is an example service on a custom image assembled by kiwi-config.
But wait, there's more!

+ +

Adminer

+

There's a mySQL database included in this project. Login with user root and password changeme.

+ +

Another hello world

+

Another web server, built in a different way.

+ +

Greetings, nginx.

+ + + \ No newline at end of file