-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtraefik.ccf-defn.jsonnet
91 lines (83 loc) · 1.95 KB
/
traefik.ccf-defn.jsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
local manifestToml = import "manifestToml.libsonnet";
local common = import "common.ccf-conf.jsonnet";
local context = import "context.ccf-facts.json";
local traefikLogsDirInContainer = "/var/log/traefik";
{
"docker-compose.yml" : std.manifestYamlDoc({
version: '3.4',
services: {
container: {
container_name: context.containerName,
image: 'traefik:latest',
restart: 'always',
ports: ['80:80', '8099:8099'],
networks: ['network'],
volumes: [
'/var/run/docker.sock:/var/run/docker.sock',
context.containerDefnHome + '/traefik.toml:/traefik.toml',
context.containerDefnHome + '/acme.json:/acme.json',
'logs:' + traefikLogsDirInContainer,
],
}
},
networks: {
network: {
external: {
name: common.defaultDockerNetworkName
},
},
},
volumes: {
logs: {
name: context.containerName + "_logs"
},
},
}),
"traefik.toml" : manifestToml({
debug: false,
logLevel: "INFO",
defaultEntryPoints: [
"http"
],
"entryPoints": {
"http": {
"address": ":80"
}
},
retry: {},
docker: {
endpoint: "unix:///var/run/docker.sock",
domain: "appliance.local",
watch: true,
exposedByDefault: false
},
traefikLog: {
filePath: traefikLogsDirInContainer + "/service.log"
},
accessLog: {
filePath: traefikLogsDirInContainer + "/access.log"
},
web: {
address: ":8099",
// auth : {
// basic : {
// users : [
// "admin:generate with htpasswd -nb secret",
// ],
// },
// },
}
}),
"after_configure.make-plugin.sh" : |||
#!/usr/bin/env bash
echo "Preparing ACME config permissions for LetsEncrypt configuration"
sudo touch acme.json
sudo chmod 600 acme.json
|||,
"container.make.inc" : |||
## Generate an HTTP Basic Auth password
htpasswd:
sudo apt-get install apache2-utils
htpasswd -nb admin secure_password
|||
}