Resources
Static Site
-
app
nginx:alpine
Running
-
ingress
www.example.com
Live
Parameters
Deploy Static Site
App Name required
my-site
Name for the deployment
Docker Image
nginx:alpine
Image containing your static files (default nginx:alpine)
Domain required
www.example.com
Public domain for the site
Enable HTTPS
On
Cancel Deploy
YAML
apiVersion: leaf/v1
kind: Template
metadata:
name: static-site
displayName: Static Site
description: Serve a static website or SPA with Nginx and a public domain. No database needed.
icon: https://github.com/nginx.png?size=256
version: '1.0.0'
category: frontend
tags: ['static', 'nginx', 'spa', 'frontend', 'html']
keywords: ['website', 'html', 'landing page', 'spa', 'nginx', 'frontend']
homepage: https://nginx.org
license: BSD-2-Clause
parameters:
- name: appName
displayName: App Name
description: Name for the deployment
type: string
default: my-site
required: true
validation:
pattern: '^[a-z][a-z0-9-]{1,58}[a-z0-9]$'
message: Must be lowercase alphanumeric with hyphens, 3-60 chars
- name: image
displayName: Docker Image
description: Image containing your static files (default nginx:alpine)
type: string
default: 'nginx:alpine'
- name: domain
displayName: Domain
description: Public domain for the site
type: string
required: true
placeholder: 'www.example.com'
- name: enableTls
displayName: Enable HTTPS
type: boolean
default: true
resources:
- name: app
type: deployment
config:
name: '{{ params.appName }}'
image: '{{ params.image }}'
replicas: 1
ports:
- name: http
containerPort: 80
servicePort: 80
protocol: TCP
- name: ingress
type: ingress
config:
host: '{{ params.domain }}'
tlsEnabled: '{{ params.enableTls }}'
routes:
- path: /
serviceName: '{{ resources.app.serviceName }}'
servicePort: 80