-
Notifications
You must be signed in to change notification settings - Fork 11
/
stackFile.yml
154 lines (144 loc) · 3.49 KB
/
stackFile.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
version: '1.0'
services:
- name: db
type: mariadb
version: 10.4
configuration: MasterSlave
database: wordpress
username: wordpress
# Ask password on create
userPassword: null
password: null
ports:
- 3306
remoteAccess: false
comments:
username: Database will be created with the same name
deployTo:
- main-one
- main-two
- name: cache
type: redis
version: 5.0
remoteAccess: false
ports:
- 6379
deployTo:
- edge
- name: blog
type: docker
image: d2cio/wordpress
version: latest
volumes:
- directory: $MAIN_PATH/wp-content/uploads
sync: true
- directory: $MAIN_PATH/wp-content/themes
sync: true
- directory: $MAIN_PATH/wp-content/plugins
sync: true
ports:
- 80
remoteAccess: false
configFiles:
- dest: $MAIN_PATH/wp-config.php
src: ./configs/wp-config.php
- dest: $MAIN_PATH/db-config.php
src: ./configs/db-config.php
- dest: $MAIN_PATH/wp-content/db.php
src: ./configs/db.php
- dest: /usr/local/etc/php/php.ini
src: ./configs/php.ini
- dest: /etc/nginx/conf.d/default.conf
src: ./configs/default.conf
localDeps: |
cmd extract
initialCommands: |
cmd wp core install --url={{=service('varnish').getNginxDomain()}} --title='"$WP_TITLE"' --admin_user=$WP_ADMIN_USERNAME --admin_password=$WP_ADMIN_PASSWORD --admin_email=$WP_ADMIN_EMAIL --path=/var/www/{{=service('blog').get('name')}}
cmd wp plugin install varnish-http-purge --activate --path=/var/www/{{=service('blog').get('name')}}
cmd wp plugin install redis-cache --activate --path=/var/www/{{=service('blog').get('name')}}
cmd wp redis enable --path=/var/www/{{=service('blog').get('name')}}
env:
SERVICE_NAME: "{{=service('blog').get('name')}}"
WP_TITLE: null
WP_ADMIN_USERNAME: null
WP_ADMIN_PASSWORD: null
WP_ADMIN_EMAIL: null
comments:
env:
WP_TITLE: The title of your Wordpress website
WP_ADMIN_USERNAME: Username of administrator account
WP_ADMIN_PASSWORD: Password of administrator account
WP_ADMIN_EMAIL: Email of administrator account
volumesUID: 33
deployTo:
- main-one
- main-two
- name: cache
type: redis
version: 5.0
remoteAccess: false
ports:
- 6379
deployTo:
- edge
- name: balancer
type: haproxy
version: latest
ports:
- 80
- 443
remoteAccess: false
serviceFiles:
- name: blog
sticky: true
deployTo:
- edge
- name: varnish
type: docker
image: d2cio/varnish
version: 6.0
ports:
- 80
remoteAccess: false
configFiles:
- dest: /etc/varnish/default.vcl
src: ./configs/default.vcl
deployTo:
- edge
- name: pma
type: docker
image: phpmyadmin/phpmyadmin
version: latest
ports:
- 80
remoteAccess: false
env:
PMA_HOST: "{{=service('db').getMasterAlias()}}"
PMA_PORT: "{{=service('db').getMainPort()}}"
deployTo:
- edge
- name: web
type: nginx
version: 1.17
ports:
- 80
- 443
remoteAccess: true
serviceFiles:
- name: varnish
- name: pma
deployTo:
- edge
hosts:
- name: main-one
requirements:
cores: 1
memory: 2
- name: main-two
requirements:
cores: 1
memory: 2
- name: edge
requirements:
cores: 1
memory: 1