-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
168 lines (157 loc) · 4.16 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
services:
twap:
container_name: twap
platform: linux/amd64
image: twap:latest
restart: unless-stopped
env_file: .env.docker
environment:
DATABASE_HOST: db
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
volumes:
- ./src:/app/src
- ./node_modules:/app/node_modules
- ./package.json:/app/package.json
- ./yarn.lock:/app/yarn.lock
- ./.env.docker:/app/.env
ports:
- '3000:3000'
networks:
- bff-network
depends_on:
- db
api:
container_name: api
platform: linux/amd64
image: api:latest
restart: unless-stopped
env_file: .env.docker
environment:
PROXY_UPSTREAM: ${PROXY_UPSTREAM}
PROXY_ORIGIN: ${PROXY_ORIGIN}
JWT_CERT_PASSPHRASE: ${JWT_CERT_PASSPHRASE}
INFURA_KEY: ${INFURA_KEY}
INFURA_JWT_ID: ${INFURA_JWT_ID}
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_USER: ${REDIS_USER}
REDIS_PASSWORD: ${REDIS_PASSWORD}
TWAP_BASE_URL: http://twap:3000/
volumes:
- ./src:/app/src
- ./node_modules:/app/node_modules
- ./package.json:/app/package.json
- ./yarn.lock:/app/yarn.lock
- ./.env.docker:/app/.env
ports:
- '1500:1500'
networks:
- bff-network
depends_on:
- db
db:
container_name: db
platform: linux/amd64
env_file: .env.docker
image: postgres:14.5-alpine
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- data-postgres:/var/lib/postgresql/data/ # using a volume
ports:
- '5432:${DATABASE_PORT}'
networks:
- bff-network
queue:
container_name: queue
# platform: linux/amd64 -- no platform as it breaks on my mac m1
image: rabbitmq:3.13.2
restart: unless-stopped
ports:
- '15672:15672'
- '5672:5672'
environment:
RABBITMQ_DEFAULT_USER: ${QUEUE_USER}
RABBITMQ_DEFAULT_PASS: ${QUEUE_PASSWORD}
volumes:
- data-rabbitmq:/var/lib/rabbitmq
networks:
- bff-network
healthcheck:
# TODO: figure out why this check doesn't succeed so telegram and notification-producer can depend on it
test: ['CMD', 'curl', '-f', 'http://localhost:15672']
interval: 30s
timeout: 10s
retries: 5
redis:
container_name: redis
image: redis:7.2.5
restart: unless-stopped
ports:
- '6379:6379'
volumes:
- data-redis:/data
- ./conf/redis/redis.conf:/usr/local/etc/redis/redis.conf
networks:
- bff-network
entrypoint: redis-server /usr/local/etc/redis/redis.conf
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:6379']
interval: 30s
timeout: 10s
retries: 5
notification-producer:
container_name: notification-producer
build:
context: .
dockerfile: ./apps/notification-producer/Dockerfile
restart: unless-stopped
env_file: .env.docker
environment:
QUEUE_HOST: ${QUEUE_HOST}
QUEUE_PORT: ${QUEUE_PORT}
QUEUE_USER: ${QUEUE_USER}
QUEUE_PASSWORD: ${QUEUE_PASSWORD}
CMS_BASE_URL: ${CMS_BASE_URL}
CMS_API_KEY: ${CMS_API_KEY}
networks:
- bff-network
depends_on:
- queue
# condition: service_healthy
telegram:
container_name: telegram
build:
context: .
dockerfile: ./apps/telegram/Dockerfile
restart: unless-stopped
env_file: .env.docker
environment:
QUEUE_HOST: ${QUEUE_HOST}
QUEUE_PORT: ${QUEUE_PORT}
QUEUE_USER: ${QUEUE_USER}
QUEUE_PASSWORD: ${QUEUE_PASSWORD}
CMS_BASE_URL: ${CMS_BASE_URL}
CMS_API_KEY: ${CMS_API_KEY}
TELEGRAM_SECRET: ${TELEGRAM_SECRET}
networks:
- bff-network
depends_on:
- queue
# condition: service_healthy
volumes:
data-postgres:
data-rabbitmq:
data-redis:
networks:
bff-network:
name: bff-network
driver: bridge