-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
141 lines (131 loc) · 4.85 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Este docker-compose se usará para desplegar los servidores de los microservicios
# en contendores para hacer el test de carga
# Indicamos la versión de docker-compose que se va a usar en el fichero
version: '3'
# Se incarán los contenedores que se van a desplegar
services:
# Contenedor para la base de datos
mongodb:
# Imagen del contenedor
image: mongo
# Nombre que tendrá en contenedor
container_name: mongodb
# Puerto interno y externo que se usará
ports:
- "27017:27017"
# Red en la que se encontrará en contenedor
networks:
# Nombre de la red
net:
# Alias de la imagen dentro de la red
aliases:
- mongodb
# El otro contenedor para la otra base de datos
postgres:
# Imagen del contenedor
image: postgres
# Nombre que tendrá en contenedor
container_name: postgres
# Variables de entorno que necesita el contenedor
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
# Puerto interno y externo que se usará
ports:
- "5433:5432"
# Red en la que se encontrará en contenedor
networks:
# Nombre de la red
net:
# Alias de la imagen dentro de la red
aliases:
- postgres
# Contenedor del microservicio notifier
notifier:
# Nombre del contenedor
container_name: notifier
# Info para construir el contenedor
build:
# Ubicación donde se encuentra el Dockefile para construir la imagen
context: ./notifier
# Argumentos usados durante la construcción del contenedor
args:
- PORT_NOTIFIER=${PORT_NOTIFIER}
- MONGO_URI=${MONGO_URI}
- SECRET_KEY=${SECRET_KEY}
# Nombre de la imagen para subirla a DockerHub
image: ibe16/notifier
# Variables de entorno que necesita el contenedor
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_BACKEND=${CELERY_BACKEND}
- MONGO_URI=${MONGO_URI}
- CORREO=${CORREO}
- PASSWORD=${PASSWORD}
- SMTP_PORT=${SMTP_PORT}
- SMTP_SERVER=${SMTP_SERVER}
- PORT_NOTIFIER=${PORT_NOTIFIER}
- SECRET_KEY=${SECRET_KEY}
# Contenedores que necesitan estar en funcionamiento para poder contruir este
depends_on:
- mongodb
# Puerto interno y externo que se usará
ports:
- "${PORT_NOTIFIER}:${PORT_NOTIFIER}"
# Red en la que se encontrará en contenedor
networks:
# Nombre de la red
net:
# Alias del contenedor dentro de la red
aliases:
- notifier
# Contenedor para el microservicio monitor
monitor:
# Nombre del contenedor
container_name: monitor
# Info para construir el contenedor
build:
# Ubicación donde se encuentra el Dockefile para construir la imagen
context: ./
# Argumentos usados durante la construcción del contenedor
args:
- PORT_MONITOR=${PORT_MONITOR}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
# Nombre de la imagen para subirla a DockerHub
image: ibe16/monitor
# Variables de entorno que necesita el contenedor
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- CELERY_BACKEND=${CELERY_BACKEND}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- MONGO_URI=${MONGO_URI}
- SECRET_KEY=${SECRET_KEY}
- PORT_MONITOR=${PORT_MONITOR}
- CORREO=${CORREO}
- PASSWORD=${PASSWORD}
- SMTP_PORT=${SMTP_PORT}
- SMTP_SERVER=${SMTP_SERVER}
# Contenedores que necesitan estar en funcionamiento para poder contruir este
depends_on:
- postgres
# Puerto interno y externo que se usará
ports:
- "${PORT_MONITOR}:${PORT_MONITOR}"
# Red en la que se encontrará en contenedor
networks:
# Nombre de la red
net:
# Alias del contenedor dentro de la red
aliases:
- monitor
# Define la red donde vamos a desplegar la imágenes
networks:
# Nombre de la red
net: