Skip to content

Commit

Permalink
First iteration of bare bones example application
Browse files Browse the repository at this point in the history
Co-authored-by: Torbjørn Hallenberg <[email protected]>
  • Loading branch information
frodesundby and toby1knby committed Jan 18, 2024
0 parents commit 5b2894a
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM busybox:latest
ENV PORT=8080

ADD ./www/index.html /www/index.html
ADD ./www/hello-nais.png /www/hello-nais.png

HEALTHCHECK CMD nc -z localhost $PORT

# Create a basic webserver and run it until the container is stopped
CMD echo "httpd started" && trap "exit 0;" TERM INT; httpd -v -p $PORT -h /www -f & wait
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Hello NAIS

This is a bare bone repository containing a simple web server.
The repository is used by the hello nais tutorial in the nais documentation.

## Local Development

### Prerequisites

- [ ] Docker CLI - via one of these alternatives:
- [Colima](https://github.com/abiosoft/colima) - Colima command-line tool (recommended)
- [Rancher](https://rancherdesktop.io) - Rancher desktop
- [Podman](https://podman-desktop.io) - Podman desktop
- [Docker desktop](https://www.docker.com/products/docker-desktop/) - Docker desktop (requires license)

### Build

1. Build Docker image:

```shell
docker build . -t hello-nais
```

2. Run Docker image:

```shell
docker run -p 8080:8080 hello-nais
```
Binary file added www/hello-nais.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: rgb(125, 159, 169);
}
.center {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
</style>
</head>
<body>
<div class="center">
<img src="hello-nais.png" alt="Hello Nais">
</div>
</body>
</html>

0 comments on commit 5b2894a

Please sign in to comment.