-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
83 lines (83 loc) · 2.45 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: '3'
services:
product_service:
container_name: "product_service"
build:
context: ./nab-product-service
environment:
ENV: "development"
PORT: 3000
MYSQL_URL: mysql://${PRODUCT_DATABASE_ROOTUSER}:${PRODUCT_DATABASE_PASSWORD}@product_db:3306/${PRODUCT_DATABASE_NAME} #use container_name refer to host
AMQP_URL: amqp://${RABBITMQ_USERNAME}:${RABBITMQ_PASSWORD}@message_queue #use container_name refer to host
AMQP_USER_ACTIVITY_QUEUE: ${ACTIVITY_QUEUE}
networks:
- product_network
- communicate_network
ports:
- "3000:3000"
depends_on:
- product_db
- message_queue
links:
- product_db
product_db:
container_name: "product_db"
image: "mysql:latest"
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${PRODUCT_DATABASE_PASSWORD}
MYSQL_DATABASE: ${PRODUCT_DATABASE_NAME}
networks:
- product_network
volumes:
- "./initial_databases/product.sql:/docker-entrypoint-initdb.d/product.sql"
message_queue:
container_name: "message_queue"
image: "bitnami/rabbitmq"
environment:
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
networks:
- communicate_network
# ports:
# - "5672:5672"
# - "15672:15672"
activity_service:
container_name: "activity_service"
build:
context: ./nab-activity-service
environment:
ENV: "development"
PORT: 3001
MONGODB_URL: mongodb://${ACTIVITY_DATABASE_USERNAME}:${ACTIVITY_DATABASE_PASSWORD}@activity_db:27017/${ACTIVITY_DATABASE_NAME}?authSource=admin
AMQP_URL: amqp://${RABBITMQ_USERNAME}:${RABBITMQ_PASSWORD}@message_queue #use container_name refer to host
AMQP_USER_ACTIVITY_QUEUE: ${ACTIVITY_QUEUE}
networks:
- activity_network
- communicate_network
depends_on:
- activity_db
- message_queue
links:
- activity_db
ports:
- "3001:3001"
activity_db:
container_name: "activity_db"
image: "mongo:latest"
networks:
- activity_network
restart: always
# ports:
# - "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${ACTIVITY_DATABASE_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${ACTIVITY_DATABASE_PASSWORD}
networks:
product_network:
driver: bridge
activity_network:
driver: bridge
communicate_network:
driver: bridge