"Docker-compose"의 두 판 사이의 차이

wwiki
이동: 둘러보기, 검색
(새 문서: == 외부링크 == https://docs.docker.com/compose/)
 
1번째 줄: 1번째 줄:
 +
== compose file ==
 +
 +
=== version 3 ===
 +
 +
==== links ====
 +
Link to containers in another service. Either specify both the service name and a link alias ("SERVICE:ALIAS"), or just the service name.<syntaxhighlight lang="yaml">
 +
web:
 +
  links:
 +
    - "db"
 +
    - "db:database"
 +
    - "redis"
 +
</syntaxhighlight>
 +
 +
==== ports ====
 +
호스트(컴퓨터)에 노출할 포트<syntaxhighlight lang="yaml">
 +
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"
 +
  - "6060:6060/udp"
 +
  - "12400-12500:1240"
 +
</syntaxhighlight>
 +
 +
==== expose ====
 +
Expose ports without publishing them to the host machine - they’ll only be accessible to linked services. Only the internal port can be specified.<syntaxhighlight lang="yaml">
 +
expose:
 +
  - "3000"
 +
  - "8000"
 +
</syntaxhighlight>
 +
 
== 외부링크 ==
 
== 외부링크 ==
 
https://docs.docker.com/compose/
 
https://docs.docker.com/compose/

2020년 10월 17일 (토) 00:46 판

compose file

version 3

links

Link to containers in another service. Either specify both the service name and a link alias ("SERVICE:ALIAS"), or just the service name.

web:
  links:
    - "db"
    - "db:database"
    - "redis"

ports

호스트(컴퓨터)에 노출할 포트

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"
  - "6060:6060/udp"
  - "12400-12500:1240"

expose

Expose ports without publishing them to the host machine - they’ll only be accessible to linked services. Only the internal port can be specified.

expose:
  - "3000"
  - "8000"

외부링크

https://docs.docker.com/compose/