Repository navigation
Expand file tree
/
Copy pathdocker-compose-example.yml
More file actions
313 lines (307 loc) · 6.88 KB
/
Copy pathdocker-compose-example.yml
File metadata and controls
313 lines (307 loc) · 6.88 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
version: '3'
services:
web:
annotations:
com.example.foo: bar
attach: false
blkio_config:
weight: 300
weight_device:
- path: /dev/sda
weight: 400
device_read_bps:
- path: /dev/sdb
rate: '12mb'
device_read_iops:
- path: /dev/sdb
rate: 120
device_write_bps:
- path: /dev/sdb
rate: '1024k'
device_write_iops:
- path: /dev/sdb
rate: 30
cpu_count: 1
cpu_percent: 35
cpu_shares: 512
cpu_period: 5h34m56s
cpu_quota: 50000
cpu_rt_runtime: '400ms'
cpu_rt_period: '1400us'
cpus: 0.5
cpuset: "2,3"
cap_add:
- ALL
cap_drop:
- NET_ADMIN
- SYS_ADMIN
cgroup: host
cgroup_parent: m-executor-abcd
image: odoo:12.0
depends_on:
- db
ports:
- "8079:8069"
- "8082:8072"
volumes:
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
- ./addons_2:/mnt/extra-addons-2
environment:
RACK_ENV: development
SHOW: "true"
command: odoo -d odoo -i base,sale,mrp
configs:
- my_config
- my_other_config
container_name: web-test
credential_spec:
file: my-credential-spec.json
dns: 8.8.8.8
dns_search: example.com
entrypoint:
- php
- -d
- zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so
- -d
- memory_limit=-1
- vendor/bin/phpunit
env_file:
- path: ./default.env
required: true # default
- path: ./override.env
required: false
group_add:
- mail
hostname: test
ipc: "shareable"
labels:
- "com.example.description=Accounting webapp"
- "com.example.department=Finance"
- "com.example.label-with-empty-value"
label_file:
- ./app.labels
- ./additional.labels
links:
- db
- db:database
- redis
logging:
driver: syslog
options:
syslog-address: "tcp://192.168.0.42:123"
restart: on-failure:4
runtime: runc
scale: 8
secrets:
- server-certificate
security_opt:
- label=user:USER
- label=role:ROLE
shm_size: 300m
stdin_open: true
stop_grace_period: 1m30s
stop_signal: SIGTERM
storage_opt:
size: '1G'
sysctls:
net.core.somaxconn: 1024
net.ipv4.tcp_syncookies: 0
ulimits:
nproc: 1024
db:
annotations:
- com.example.foo=bar
cgroup: private
image: postgres:12
ports:
- "5442:5432"
cpuset: "0-3"
depends_on:
db:
condition: service_healthy
restart: true
redis:
condition: service_started
environment:
- POSTGRES_DB=odoo
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- db-data:/var/lib/postgresql/data
configs:
- source: my_config
target: /redis_config
uid: "103"
gid: "103"
mode: 0440
credential_spec:
registry: my-credential-spec
device_cgroup_rules:
- 'c 1:3 mr'
- 'a 7:* rmw'
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
- "/dev/sda:/dev/xvda:rwm"
dns:
- 8.8.8.8
- 9.9.9.9
dns_opt:
- use-vc
- no-tld-query
dns_search:
- dc1.example.com
- dc2.example.com
driver_opts:
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
entrypoint: /code/entrypoint.sh
env_file:
- ./a.env
- ./b.env
expose:
- "3000"
- "8000"
- "8080-8085/tcp"
extends:
file: common.yml
service: webapp
external_links:
- redis
- database:mysql
- database:postgresql
extra_hosts:
- "somehost=162.242.195.82"
- "otherhost=50.31.209.229"
- "myhostv6=::1"
gpu:
- driver: 3dfx
count: 2
ipc: "service:[service name]"
labels:
com.example.description: "Accounting webapp"
com.example.department: "Finance"
com.example.label-with-empty-value: ""
label_file: ./app.labels
mem_swappiness: 60
memswap_limit: 300m
network_mode: "service:[service name]"
networks:
- some-network
- other-network
oom_kill_disable: true
oom_score_adj: -400
pid: 5
pid_limit: 65
post_start:
- command: ./do_something_on_startup.sh
user: root
privileged: true
environment:
- FOO=BAR
pre_stop:
- command: ./do_something_on_startup.sh
user: root
privileged: true
environment:
- FOO=BAR
privileged: true
profiles: ["frontend"]
pull_policy: daily
read_only: true
restart: always
secrets:
- source: server-certificate
target: server.cert
uid: "103"
gid: "103"
mode: "0o440"
sysctls:
- net.core.somaxconn=1024
- net.ipv4.tcp_syncookies=0
tmpfs:
- /data:mode=755,uid=1009,gid=1009
- /run
ulimits:
nofile:
soft: 20000
hard: 40000
user: root
userns_mode: "host"
uts: "host"
volumes_from:
- service_name
- service_name:ro
working_dir: /home/test
volumes:
db-data:
driver: foobar
driver_opts:
type: "nfs"
o: "addr=10.40.0.199,nolock,soft,rw"
device: ":/docker/example"
external: true
labels:
com.example.description: "Database volume"
com.example.department: "IT/Ops"
com.example.label-with-empty-value: ""
name: db-data
web-data:
labels:
- "com.example.description=Web volume"
- "com.example.department=IT/Ops"
- "com.example.label-with-empty-value"
networks:
frontend:
driver_opts:
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
internal: true
labels:
- "com.example.description=Financial transaction network"
- "com.example.department=Finance"
- "com.example.label-with-empty-value"
backend:
driver: bridge
attachable: true
labels:
com.example.description: "Financial transaction network"
com.example.department: "Finance"
com.example.label-with-empty-value: ""
ip6net:
enable_ipv4: false
enable_ipv6: true
ipam_test:
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
ip_range: 172.28.5.0/24
gateway: 172.28.0.1
aux_addresses:
host1: 172.28.1.5
host2: 172.28.1.6
host3: 172.28.1.7
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
options:
foo: bar
baz: "0"
name: my-app-name
# Example 1: File Config
configs:
http_config:
file: ./http.conf
http_config2:
external: true
name: external test
app_config:
content: |
debug=${DEBUG}
...
app_config2:
environment: DEBUG
secrets:
server-certificate:
file: ./server.cert
token:
environment: "OAUTH_TOKEN"