-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
118 lines (116 loc) · 2.98 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
version: '3.8'
services:
rabbit:
image: rabbitmq:3.11-management
container_name: rabbit
ports:
- "5672:5672"
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
volumes:
- ./rabbitmq-script.sh:/rabbitmq-script.sh
- ./.env:/tmp/rabbitmq.env # Mount the .env file
command: >
bash -c "
rabbitmq-server &
sleep 10
rabbitmqctl wait /var/lib/rabbitmq/mnesia/[email protected]
/rabbitmq-script.sh
wait
"
networks:
- app_network
mongo:
image: mongo:latest
container_name: mongo
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
restart: always
networks:
- app_network
postgres:
image: postgres:13
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- app_network
auth-service:
build:
context: ./auth-service
dockerfile: Dockerfile
container_name: auth-service
depends_on:
- postgres
- rabbit
networks:
- app_network
environment:
RABBITMQ_URI: ${RABBITMQ_URI}
EMAIL_QUEUE_NAME: ${EMAIL_QUEUE_NAME}
SCAN_QUEUE_NAME: ${SCAN_QUEUE_NAME}
RPC_QUEUE_NAME: ${RPC_QUEUE_NAME}
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${POSTGRES_DB}
DB_USERNAME: ${POSTGRES_USER}
DB_PASSWORD: ${POSTGRES_PASSWORD}
JWT_DEV_SECRET: ${JWT_DEV_SECRET}
JWT_PROD_SECRET: ${JWT_PROD_SECRET}
PORT: 3000
HOST: localhost
ports:
- "3000:3000"
scanner-service:
build:
context: ./scanner-service # This is where your Golang project should be located
dockerfile: Dockerfile # Dockerfile for your Golang project
container_name: scanner-service
depends_on:
- rabbit
- mongo
environment:
RABBITMQ_URI: ${RABBITMQ_URI}
MONGO_CONNECTION_URI: ${MONGO_CONNECTION_URI}
AUTH_SERVICE_URI: ${AUTH_SERVICE_URI}
EMAIL_QUEUE_NAME: ${EMAIL_QUEUE_NAME}
SCAN_QUEUE_NAME: ${SCAN_QUEUE_NAME}
RPC_QUEUE_NAME: ${RPC_QUEUE_NAME}
command: go run main.go # Command to run your Golang application after build
restart: always
networks:
- app_network
email-service:
build:
context: ./email-service
dockerfile: Dockerfile
container_name: email-service
depends_on:
- rabbit
networks:
- app_network
environment:
RABBITMQ_URI: ${RABBITMQ_URI}
EMAIL_QUEUE_NAME: ${EMAIL_QUEUE_NAME}
MAIL_HOST: ${MAIL_HOST}
MAIL_PORT: ${MAIL_PORT}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
MAIL_DEFAULT_FROM: ${MAIL_DEFAULT_FROM}
volumes:
rabbitmq_data:
mongo-data:
scanner-service:
postgres-data:
networks:
app_network:
driver: bridge