Hello World
End-to-end walkthrough: create an app, write a Dockerfile, add an infraspec, forge infrastructure, deploy, and visit it live.
What you'll build
A simple HTTP server that responds with "Hello from Norn!" — discovered, forged, and deployed through Norn.
Prerequisites
- Norn running locally (
make dev) - Docker installed
- CLI installed (
make install)
1. Create the app
bash
mkdir -p ~/projects/hello-norn
cd ~/projects/hello-norn2. Write the server
Create main.go:
go
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello from Norn!")
})
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
})
http.ListenAndServe(":3000", nil)
}3. Add a Dockerfile
dockerfile
FROM golang:1.25-alpine AS build
WORKDIR /app
COPY . .
RUN go build -o server .
FROM alpine:3.21
COPY --from=build /app/server /server
EXPOSE 3000
CMD ["/server"]4. Create the infraspec
Create infraspec.yaml:
yaml
app: hello-norn
role: webserver
port: 3000
healthcheck: /health
deploy: true
build:
dockerfile: Dockerfile5. Verify discovery
bash
norn statusYou should see hello-norn listed with "never deployed".
6. Forge infrastructure
bash
norn forge hello-nornThis creates the Kubernetes Deployment and Service. For cron or function apps, it just registers them.
7. Deploy
bash
norn deploy hello-norn HEADWatch the seven-step pipeline:
- clone — copy source files
- build —
docker build -t hello-norn:latest . - test — skipped (no test command)
- snapshot — skipped (no database)
- migrate — skipped (no migrations)
- deploy — update K8s deployment image
- cleanup — remove temp files
8. Visit
Open the dashboard at localhost:5173 — hello-norn should show a green health dot.
From the CLI:
bash
norn status hello-norn # detailed status
norn logs hello-norn # stream logs
norn health # check all servicesNext steps
- Concepts — understand roles, services, and forge vs deploy
- Infraspec Reference — all configuration fields
- Roles Guide — webserver, worker, cron, function examples