Skip to content

Commit

Permalink
feat: add Celery and Rabbitmq
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Jan 16, 2023
1 parent 57c93b5 commit 79718e4
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ services:
volumes:
- ./buyself-backend/:/buyself-backend/
environment:
FLASK_ENV: app
FLASK_ENV: development
FLASK_DEBUG: 1
networks:
- app-tier

react:
build:
Expand All @@ -19,4 +22,49 @@ services:
- 3000:3000
volumes:
- ./buyself-frontend/:/buyself-frontend
- ./buyself-frontend/node_modules/:/buyself-frontend/node_modules
- ./buyself-frontend/node_modules/:/buyself-frontend/node_modules
networks:
- app-tier

rabbitmq:
hostname: rabbit # 도컀 μ»¨ν…Œμ΄λ„ˆμ˜ 호슀트 λ‚΄μž„
image: rabbitmq:3-management # λž˜λΉ—μ— ν 이미지 버전
command: rabbitmq-server # μ»¨ν…Œμ΄λ„ˆ μˆ˜ν–‰ν•  λͺ…λ Ήμ–΄
restart: unless-stopped # μ»¨ν…Œμ΄λ„ˆ μ’…λ£Œμ‹œ (μž¬μ‹œμž‘μ—¬λΆ€) μ’…λ£Œ μ½”λ“œμ™€ 상관없이 μ»¨ν…Œμ΄λ„ˆκ°€ λ‹€μ‹œμ‹œμž‘ν•˜μ§€λ§Œ μ„œλΉ„μŠ€κ°€ μ€‘μ§€λ˜κ±°λ‚˜ 제거되면 λ‹€μ‹œ μ‹œμž‘μ„ μ€‘μ§€ν•œλ‹€
environment:
- RABBITMQ_DEFAULT_USER=buyselfback #rabbitmq 아이디
- RABBITMQ_DEFAULT_PASS=buyselfback #rabbitmq λΉ„λ°€λ²ˆν˜Έ
ports:
- 5672:5672 #rabbitmq AMQP 기본 포트 번호
- 15672:15672 #Rabbitmq web
networks:
- app-tier
depends_on: #depends_on은 λ‹€λ₯Έ μ„œλΉ„μŠ€μ— λŒ€ν•œ μ˜μ‘΄κ΄€κ³„λ₯Ό λ‚˜νƒ€λƒ„, μ»¨ν…Œμ΄λ„ˆλ₯Ό μƒμ„±ν•˜λŠ” μˆœμ„œλ‚˜ 연동 μ—¬λΆ€λ₯Ό μ •μ˜
- back

celery:
build:
context: ./buyself-backend
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- "rabbitmq"
- "back"
networks:
- app-tier
command:
[
"celery",
"-A",
"tasks",
"worker",
"--loglevel=info",
"--pool",
"threads",
]



networks:
app-tier:
driver: bridge

0 comments on commit 79718e4

Please sign in to comment.