赞
踩
container_name: my-web-container
- redis
db:
image: postgres
tmpfs:
- /run
- /tmp
entrypoint: /code/entrypoint.sh
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: .env
env_file:
- ./common.env
- ./apps/web.env
- SHOW=true
- SESSION_SECRET
expose:
- "3000"
- "8000"
--add-host
parameter.
extra_hosts:
- "somehost:162.242.195.82"
/etc/hosts
:
162.242.195.82 somehost
50.31.209.229 otherhost
image: redis
image: ubuntu:14.04image: tutum/influxdb
image: example-registry.com:4000/postgresql
image: a4bc65fd
labels:
com.example.description: "Accounting webapp"
com.example.department: "Finance"
com.example.label-with-empty-value: ""
labels:
- "com.example.description=Accounting webapp"
- "com.example.department=Finance"
- "com.example.label-with-empty-value"
- redis
options:
syslog-address: "tcp://192.168.0.42:123"
net: "bridge"
net: "host"
net: "none"
net: "container:[service name or container name/id]"
network_mode: "bridge"
network_mode: "host"
network_mode: "none"
network_mode: "service:[service name]"
network_mode: "container:[container name/id]"
Version 2 file format only. In version 1, use net.
networks
key.
pid: "host"
ports:
- "3000"
- "3000-3005"
- "8000:8000"
- "9090-9091:8080-8081"
- "49100:22"
- "127.0.0.1:8001:8001"
- "127.0.0.1:5000-5010:5000-5010"
volumes:
# Just specify a path and let the Engine create a volume
- /var/lib/mysql
# Specify an absolute path mapping
- /opt/data:/var/lib/mysql
# Path on the host, relative to the Compose file
- ./cache:/tmp/cache
# User-relative path
- ~/configs:/etc/configs/:ro
# Named volume
volume_driver
.例如rancher的convoy fs。
volume_driver: mydriver
ro
)或读写 (
rw
). 如果不设置,默认为读写模式。
Note: The container:...
formats are only supported in the version 2 file format. In version 1, you can use container names without marking them as such:
- service_name
- service_name:ro
- container_name
- container_name:rw
driver: foobar
You can also specify the name of the volume separately from the name used to refer to it within the Compose file:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。