image¶ tag or partial image ID. Can be local or remote. Compose will attempt to pull if it doesnot exist locally: image : ubuntu image : a4c42

build¶ path to a directory containing a Dockerfile. When the value supplied is a relative path, it is interpreted as relative to the location of the yml file itself. This directory is also the build context that is sent to the Docker daemon. Compose will build and tag it with a generated name and use that image thereafter

dockerfile¶ Alternate Dockerfile compose will use an alternate file to build with dockerfile : Dockerfile - alternate

command¶ override the default command command : bundle exec thin - p 3000

ports¶ expose ports. Either specify both ports(HOSTPORT:CONTAINPORT) or just the container port: ports : - "3000" - "5601:5601" - "39200:9200" - "127.0.0.1:9200:9200" Note When mapping ports in the HOST:CONTAINER format, you may experience erroneous results when using a container port lower than 60, because YAML will parse numbers in the format xx:yy as sexagesimal (base 60). For this reason, we recommend always explicitly specifying your port mappings as strings.

expose¶ Expose ports without publishing them to the host machine - they will only be accessible to linked services: expose : - "6379" - "9200"

volumes¶ mount paths as volumes, optionally specifying a path on the host machine(HOST:CONTAINER) or an access mode(HOST:CONTAINER:ro): volumes : - / var / lib / mysql - ~/ configs : / etc / configs / : ro

volumes_from¶ mount all of the volumes from another services or container: volues_from : - service_name - container_name

environment¶ add environment variables. You can use either an array or a dictionary. Environment variables with only a key are resolved to their values on the machine Compose is running on, which can be helpful for secret or host-specific values: environment : RACK_ENV : development SESSION_SECRET : environment : - RACK_ENV = development - SESSION_SECRET

env_file¶ Add environment variables from a file. Can be a single value or a list. If you have specified a Compose file with docker-compose -f FILE, paths in env_file are relative to the directory that file is in.