-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
69 lines (64 loc) · 1.89 KB
/
docker-compose.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
version: '3.8'
services:
# rabbitmq:
# image: rabbitmq:management
# container_name: rabbitmq
# environment:
# - RABBITMQ_DEFAULT_USER=guest
# - RABBITMQ_DEFAULT_PASS=guest
# ports:
# - "5672:5672"
# - "15672:15672"
# healthcheck:
# test: ["CMD", "rabbitmqctl", "status"]
# interval: 10s
# timeout: 5s
# retries: 3
main_service:
build:
context: ./Main
dockerfile: Dockerfile
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
# command: dockerize -wait tcp://rabbitmq:5672 bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
container_name: main_service
volumes:
- ./Main:/app
ports:
- "8000:8000"
depends_on:
- rabbitmq
restart: on-failure
like_service:
build:
context: ./Like-Service
dockerfile: Dockerfile
command: bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:5000"
# command: dockerize -wait tcp://rabbitmq:5672 bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:5000"
container_name: like_service
volumes:
- ./Like-Service:/app
ports:
- "5000:5000"
depends_on:
- rabbitmq
links:
- rabbitmq
entrypoint: bash -c "python manage.py runserver 0.0.0.0:5000 & python consumer.py"
restart: on-failure
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 5s
retries: 3
networks:
default:
driver: bridge