일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- AWS S3
- 갓재석
- 우아한 테크코스 2차 합격
- javascript
- EC2
- 우아한테크코스 2차
- python
- 프로그래머스
- depends
- MySQL server on 'db' (115)
- Spring
- AWS
- S3
- 코딩테스트
- depends_on
- classproperty
- python all testcode
- METACLASS
- springboot 3.0.0
- Django
- 2차 코딩테스트
- docker
- classmethod
- github
- 재귀함수가 뭔가요
- github skyline
- TypeError: 'property' object is not iterable
- DB
- docker-compose
- OperationalError
Archives
ㅁㄴㅇㄻㄴㅇㄹ
[Docker] docker-compose depends_on 에 대해 본문
depends_on
Express dependency between services. Service dependencies cause the following behaviors:
- docker-compose upstarts services in dependency order. In the following example,dbandredisare started beforeweb.
- docker-compose up SERVICEautomatically includesSERVICE’s dependencies. In the example below,docker-compose up webalso creates and startsdbandredis.
- docker-compose stopstops services in dependency order. In the following example,webis stopped beforedbandredis.
docker-compose up 은 순서대로 서비스를 실행하는데, depends_on이 여기에 영향을 미친다.
version: "3.7"
services:
web:
build: .
depends_on:
- db
db:
image: mysql:8.0.22
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
예를 들어 위와 같은 docker-compose 파일이 있다면, db 서비스가 먼저 실행되고, web 서비스가 그 다음으로 실행된다.
출처