Creates project directory structure in /docker Creates docker-compose.yml with sensible defaults Creates borgmatic config in /etc/borgmatic.d Adds proxy info to caddyfile and reloads caddy Config file generation done via jsonnet and yq Borgmatic configured to backup to borgbase repo
33 lines
675 B
Jsonnet
33 lines
675 B
Jsonnet
function(
|
|
project,
|
|
image,
|
|
web_port="0000:0000",
|
|
ports=[],
|
|
tag="latest",
|
|
restart="unless-stopped"
|
|
)
|
|
|
|
{
|
|
"name": project,
|
|
"services": {
|
|
"app": {
|
|
"image": image + ':' + tag,
|
|
"restart": restart,
|
|
"ports": std.uniq(std.sort(std.flattenArrays([ports, [web_port]]))),
|
|
"environment": {
|
|
"DOCKER_TEMPLATE_CREATED": true
|
|
},
|
|
"volumes": [
|
|
'./data:/data'
|
|
],
|
|
"secrets": [
|
|
'asecret'
|
|
]
|
|
}
|
|
},
|
|
"secrets": {
|
|
"asecret": {
|
|
"file": './secrets/ASECRET'
|
|
}
|
|
}
|
|
} |