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

(새 문서: ==개요== {{소문자}} ;docker-compose.yml <syntaxhighlight lang='yaml'> version: "3.9" services: web: build: . ports: - "8000:5000" redis: image: "redis:alpi...)
 
 
(같은 사용자의 중간 판 5개는 보이지 않습니다)
2번째 줄: 2번째 줄:
{{소문자}}
{{소문자}}
;docker-compose.yml
;docker-compose.yml
;compose file
;컴포즈 파일


<syntaxhighlight lang='yaml'>
<syntaxhighlight lang='yaml'>
12번째 줄: 14번째 줄:
   redis:
   redis:
     image: "redis:alpine"
     image: "redis:alpine"
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
version: "3.9"
services:
  web:
    build: .
    ports:
      - "8000:5000"
    volumes:
      - .:/code
    environment:
      FLASK_DEBUG: True
  redis:
    image: "redis:alpine"
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
version: "3.9"  # optional since v1.27.0
services:
  web:
    build: .
    ports:
      - "8000:5000"
    volumes:
      - .:/code
      - logvolume01:/var/log
    depends_on:
      - redis
  redis:
    image: redis
volumes:
  logvolume01: {}
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
services:
  frontend:
    image: awesome/webapp
    ports:
      - "443:8043"
    networks:
      - front-tier
      - back-tier
    configs:
      - httpd-config
    secrets:
      - server-certificate
  backend:
    image: awesome/database
    volumes:
      - db-data:/etc/data
    networks:
      - back-tier
volumes:
  db-data:
    driver: flocker
    driver_opts:
      size: "10GiB"
configs:
  httpd-config:
    external: true
secrets:
  server-certificate:
    external: true
networks:
  # The presence of these objects is sufficient to define them
  front-tier: {}
  back-tier: {}
</syntaxhighlight>
</syntaxhighlight>


20번째 줄: 93번째 줄:


==참고==
==참고==
* https://docs.docker.com/compose/compose-file/
* https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file
* https://docs.docker.com/compose/gettingstarted/#step-3-define-services-in-a-compose-file
[[분류: Docker Compose]]
 
[[분류: .yml]]
[[분류: docker-compose.yml]]

2023년 1월 22일 (일) 00:18 기준 최신판

1 개요[ | ]

docker-compose.yml
compose file
컴포즈 파일
version: "3.9"
services:
  web:
    build: .
    ports:
      - "8000:5000"
  redis:
    image: "redis:alpine"
version: "3.9"
services:
  web:
    build: .
    ports:
      - "8000:5000"
    volumes:
      - .:/code
    environment:
      FLASK_DEBUG: True
  redis:
    image: "redis:alpine"
version: "3.9"  # optional since v1.27.0
services:
  web:
    build: .
    ports:
      - "8000:5000"
    volumes:
      - .:/code
      - logvolume01:/var/log
    depends_on:
      - redis
  redis:
    image: redis
volumes:
  logvolume01: {}
services:
  frontend:
    image: awesome/webapp
    ports:
      - "443:8043"
    networks:
      - front-tier
      - back-tier
    configs:
      - httpd-config
    secrets:
      - server-certificate

  backend:
    image: awesome/database
    volumes:
      - db-data:/etc/data
    networks:
      - back-tier

volumes:
  db-data:
    driver: flocker
    driver_opts:
      size: "10GiB"

configs:
  httpd-config:
    external: true

secrets:
  server-certificate:
    external: true

networks:
  # The presence of these objects is sufficient to define them
  front-tier: {}
  back-tier: {}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}