-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
119 lines (116 loc) · 3.75 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
version: '3.8'
services:
records_postgres:
image: records_postgres:${POSTGRES_VERSION_TAG}
container_name: records_postgres
build:
context: database
dockerfile: dockerfile
args:
POSTGRES_VERSION_TAG: ${POSTGRES_VERSION_TAG}
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: ${POSTGRES_USERNAME}
POSTGRES_DB: ${POSTGRES_DATABASE}
TZ: ${TZ}
ports:
- ${POSTGRES_PORT}:5432
volumes:
- ${POSTGRES_VOLUME_DIR}:/var/lib/postgresql/data
restart: always
healthcheck:
test: pg_isready -U ${POSTGRES_USERNAME}
interval: 15s
timeout: 10s
retries: 5
records_rabbitmq:
image: rabbitmq:${RABBITMQ_VERSION_TAG}
container_name: records_rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
TZ: ${TZ}
ports:
- ${RABBITMQ_WEBAPP_PORT}:15672
- ${RABBITMQ_PORT}:5672
volumes:
- ${RABBITMQ_VOLUME_DIR}:/var/lib/rabbitmq
restart: always
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
records_producer:
image: records_producer:latest
container_name: records_producer
build:
context: producer
dockerfile: dockerfile
args:
AMAZON_LINUX_VERSION_TAG: ${AMAZON_LINUX_VERSION_TAG}
environment:
TARGET_FILE_DIR: ${TARGET_FILE_DIR}
TARGET_FILE_EXTENSION: ${TARGET_FILE_EXTENSION}
LOG_LEVEL: ${PRODUCER_LOG_LEVEL}
LOG_FORMAT: ${PRODUCER_LOG_FORMAT}
LOG_DATE_FORMAT: ${PRODUCER_LOG_DATE_FORMAT}
LOG_DIR: ${PRODUCER_LOG_DIR}
LOG_RETENTION: ${PRODUCER_LOG_RETENTION}
LOG_ROTATION: ${PRODUCER_LOG_ROTATION}
RABBITMQ_HOST: records_rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
RABBITMQ_QUEUE_NAME: ${RABBITMQ_QUEUE_NAME}
RABBITMQ_SOCKET_TIMEOUT: ${RABBITMQ_SOCKET_TIMEOUT}
TZ: ${TZ}
volumes:
- ${TARGET_FILE_DIR}:/app/${TARGET_FILE_DIR}:ro
- ${PRODUCER_LOG_DIR}:/app/${PRODUCER_LOG_DIR}
depends_on:
records_postgres:
condition: service_healthy
records_rabbitmq:
condition: service_healthy
records_consumer:
image: records_consumer:latest
build:
context: consumer
dockerfile: dockerfile
args:
AMAZON_LINUX_VERSION_TAG: ${AMAZON_LINUX_VERSION_TAG}
environment:
LOG_LEVEL: ${CONSUMER_LOG_LEVEL}
LOG_FORMAT: ${CONSUMER_LOG_FORMAT}
LOG_DATE_FORMAT: ${CONSUMER_LOG_DATE_FORMAT}
LOG_DIR: ${CONSUMER_LOG_DIR}
LOG_RETENTION: ${CONSUMER_LOG_RETENTION}
LOG_ROTATION: ${CONSUMER_LOG_ROTATION}
RABBITMQ_HOST: records_rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USERNAME: ${RABBITMQ_USERNAME}
RABBITMQ_PASSWORD: ${RABBITMQ_PASSWORD}
RABBITMQ_QUEUE_NAME: ${RABBITMQ_QUEUE_NAME}
RABBITMQ_POLLING_TIMEOUT: ${RABBITMQ_POLLING_TIMEOUT}
RABBITMQ_SOCKET_TIMEOUT: ${RABBITMQ_SOCKET_TIMEOUT}
POSTGRES_HOST: records_postgres
POSTGRES_PORT: 5432
POSTGRES_USERNAME: ${POSTGRES_USERNAME}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DATABASE: ${POSTGRES_DATABASE}
POSTGRES_BATCH_UPSERT_SIZE: ${POSTGRES_BATCH_UPSERT_SIZE}
CSV_PARSER_DELIMITER: ${CSV_PARSER_DELIMITER}
CSV_PARSER_FILE_EXTENSION: ${CSV_PARSER_FILE_EXTENSION}
TZ: ${TZ}
volumes:
- ${TARGET_FILE_DIR}:/app/${TARGET_FILE_DIR}:ro
- ${CONSUMER_LOG_DIR}:/app/${CONSUMER_LOG_DIR}
deploy:
mode: replicated
replicas: ${CONSUMER_REPLICAS}
depends_on:
records_postgres:
condition: service_healthy
records_rabbitmq:
condition: service_healthy