-
Notifications
You must be signed in to change notification settings - Fork 6
/
kontena.yml
117 lines (107 loc) · 2.7 KB
/
kontena.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
stack: jussi/wordpress
version: 0.1.0
variables:
lb:
type: string
from:
env: LOADBALANCER
service_link:
prompt: Choose a loadbalancer
image: kontena/lb
vhost:
type: string
from:
prompt: Hostname of the WP setup
admin_user:
type: string
from:
prompt: Admin username
admin_email:
type: string
from:
prompt: Admin email
admin_password:
type: string
from:
vault: ${STACK}-admin-password
random_string: 24
to:
vault: ${STACK}-admin-password
# Unique secrets
wp_secret:
type: string
from:
vault: ${STACK}-secret
env: WORDPRESS_SECRET
random_string: 24
to:
vault: ${STACK}-secret
# Resolve the number of instances from the existing deployment
# Scaling up happens with kontena service scale ...
# Next deployment will respect that
instances:
type: integer
default: 1
from:
service_instances: wordpress
depends:
galera:
stack: galera.yml
services:
wordpress:
image: jnummelin/wordpress:edge
instances: {{ instances }}
build: .
links:
- ${lb}
volumes:
- wp-uploads:/var/www/html/wp-content/uploads
environment:
WORDPRESS_DB_HOST: {{ galera }}
WORDPRESS_SITE_URL: ${vhost}
WORDPRESS_SITE_DESCRIPTION: "Wanna-be troutbum who dreams of big fish"
WORDPRESS_ADMIN_USER: ${admin_user}
WORDPRESS_ADMIN_EMAIL: ${admin_email}
KONTENA_LB_VIRTUAL_HOSTS: ${vhost}
secrets:
# Secret generated in the child stack
- secret: ${STACK}-galera-mysql-pwd
name: WORDPRESS_DB_PASSWORD
type: env
- secret: ${STACK}-admin-password
name: WORDPRESS_ADMIN_PASSWORD
type: env
# For simplicity sake, use same secret for all
- secret: ${STACK}-secret
name: WORDPRESS_AUTH_KEY
type: env
- secret: ${STACK}-secret
name: WORDPRESS_SECURE_AUTH_KEY
type: env
- secret: ${STACK}-secret
name: WORDPRESS_LOGGED_IN_KEY
type: env
- secret: ${STACK}-secret
name: WORDPRESS_NONCE_KEY
type: env
- secret: ${STACK}-secret
name: WORDPRESS_AUTH_SALT
type: env
- secret: ${STACK}-secret
name: WORDPRESS_SECURE_AUTH_SALT
type: env
- secret: ${STACK}-secret
name: WORDPRESS_LOGGED_IN_SALT
type: env
- secret: ${STACK}-secret
name: WORDPRESS_NONCE_SALT
type: env
hooks:
post_start:
- cmd: chown -R www-data:www-data /var/www/html/wp-content/uploads
name: chown_uploads
oneshot: true
instances: 1
volumes:
wp-uploads: # Networked, scope=stack
external: true