forked from tldr-devops/startpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
portainer.yml
96 lines (89 loc) · 2.68 KB
/
portainer.yml
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
92
93
94
95
96
version: '3.8'
x-portainer-labels: &portainer-labels
labels:
- traefik.enable=true
- traefik.docker.network=portainer
- traefik.http.routers.portainer-http.rule=Host(`portainer.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.portainer-http.entrypoints=http
- traefik.http.routers.portainer-http.service=portainer
- traefik.http.routers.portainer-http.middlewares=https-redirect
- traefik.http.routers.portainer-https.rule=Host(`portainer.${DOMAIN?Variable DOMAIN not set}`)
- traefik.http.routers.portainer-https.entrypoints=https
- traefik.http.routers.portainer-https.tls=true
- traefik.http.routers.portainer-https.service=portainer
- traefik.http.routers.portainer-https.tls.certresolver=le
- traefik.http.services.portainer.loadbalancer.server.port=9000
x-service: &service
logging:
driver: json-file
options:
max-size: "100m"
max-file: "2"
restart: always
networks:
- portainer
services:
# https://hub.docker.com/portainer/portainer-ce
portainer:
container_name: portainer
image: portainer/portainer-ce:alpine
deploy:
mode: replicated
replicas: 1
resources:
reservations:
cpus: '0.03'
memory: 50M
placement:
constraints:
- node.hostname == ${HOSTNAME?Variable HOSTNAME not set}
<<: *portainer-labels
<<: *portainer-labels
<<: *service
command:
#- --admin-password=${PORTAINER_HASHED_PASSWORD?Variable PORTAINER_HASHED_PASSWORD not set} # doesn't work in any tried variant, with escaping $$, diff hashes...
- --host=tcp://portainer-agent:9001
- --tlsskipverify
- --no-analytics
- --http-enabled
volumes:
- portainer-data:/data
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: ["CMD-SHELL", "wget --spider http://localhost:9000"]
interval: 1s
timeout: 1s
retries: 120
start_period: 2s
portainer-agent:
container_name: portainer-agent
image: portainer/agent
deploy:
mode: global
resources:
reservations:
cpus: '0.01'
memory: 10M
placement:
constraints:
- node.platform.os == linux
<<: *service
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
x-volume: &volume
driver: local
x-volume-driver-opts: &volume-driver-opts
type: none
o: bind
volumes:
portainer-data:
name: portainer-data
<<: *volume
driver_opts:
<<: *volume-driver-opts
device: ${DATAPATH?Variable DATAPATH not set}/portainer/data
networks:
portainer:
name: portainer
external: true