Compose file specification
levv uses YAML files, as defined in the compose specification, to define and deploy services.
The elements within the specification can determine service characteristics such as disk volumes, networking, environment variables, etc. However, levv uses only a subset of these to define services.
Next to that, levv also makes use of annotations (defined as labels) to indicate characteristics or behaviors, such as defining a container size, and exposing services to the internet.
Full Example
services:
backend:
image: myrepo/myimage:latest
deploy:
replicas: 2
labels:
io.levv.size: "small"
environment:
DEPLOYMENT: production
LOG_LEVEL: debug
secrets:
- source: storage_keys
volumes:
- files-disk:/usr/local/data
db:
image: redis
deploy:
replicas: 1
labels:
io.levv.size: "medium"
secrets:
- source: token
ports:
- 6379:6379
frontend:
image: nginx
deploy:
replicas: 2
labels:
io.levv.size: "micro"
io.levv.public: "80/http"
ports:
- "80:80"
domainname: "example.com"
secrets:
storage_keys:
file: /home/user/secret.txt
token:
environment: "MY_SECRET_TOKEN"
volumes:
files-disk:
driver_opts:
size: 2G