-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
166 lines (154 loc) · 4.27 KB
/
Copy pathdocker-compose.yml
File metadata and controls
166 lines (154 loc) · 4.27 KB
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
services:
postgres:
image: postgres:latest
container_name: postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: file_processor
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
healthcheck:
test:
["CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "file_processor"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./volumes/postgres-data:/var/lib/postgresql/data
- ./infrastructure/pg_init:/docker-entrypoint-initdb.d
env_file:
- .env
minio:
image: minio/minio
container_name: minio
ports:
- "9002:9000" # MinIO API
- "9001:9001" # MinIO Console
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
command: server /data --console-address ":9001"
entrypoint:
["sh", "-c", "chmod +x /usr/bin/minio_init.sh && /usr/bin/minio_init.sh"]
healthcheck:
test: ["CMD", "curl", "-f", "http://minio:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./volumes/minio-data:/data
- ./infrastructure/minio/minio_init.sh:/usr/bin/minio_init.sh
env_file:
- .env
nats:
image: nats:latest
container_name: nats
ports:
- "4222:4222"
- "8222:8222"
command: "-js"
healthcheck:
test: ["CMD", "nats-server", "--help"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./volumes/nats-data:/data
sse-server:
container_name: sse-server
build:
context: ./sse
ports:
- "8081:8081"
file-processing-service:
container_name: file-processing-service
build:
context: ./file-processing-service
environment:
MINIO_ENDPOINT: minio
MINIO_PORT: ${MINIO_PORT}
MINIO_USE_SSL: false
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_STAGING_BUCKET: staging
MINIO_PROCESSED_BUCKET: processed
NATS_SERVERS: nats://nats:4222
NATS_STAGED_SUBJECT: file.upload.completed
NATS_PROCESSED_SUBJECT: file.processing.completed
depends_on:
minio:
condition: service_healthy
nats:
condition: service_healthy
env_file:
- .env
file-upload-service:
container_name: file-upload-service
build:
context: ./file-upload-service
ports:
- "3002:3002"
environment:
LOGGER_LEVEL: ${LOGGER_LEVEL}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USER: ${DATABASE_USER}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
DATABASE_NAME: ${DATABASE_NAME}
MINIO_ENDPOINT: ${MINIO_ENDPOINT}
MINIO_PORT: ${MINIO_PORT}
MINIO_USE_SSL: ${MINIO_USE_SSL}
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
MINIO_STAGING_BUCKET: ${MINIO_STAGING_BUCKET}
MINIO_PROCESSED_BUCKET: ${MINIO_PROCESSED_BUCKET}
NATS_SERVERS: ${NATS_SERVERS}
NATS_STAGED_SUBJECT: ${NATS_STAGED_SUBJECT}
NATS_PROCESSED_SUBJECT: ${NATS_PROCESSED_SUBJECT}
SSE_BROADCAST_URL: ${SSE_BROADCAST_URL}
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
nats:
condition: service_healthy
sse-server:
condition: service_started
file-processing-service:
condition: service_started
frontend:
container_name: frontend
build:
context: ./frontend
# ports:
# - "3000:3000"
environment:
API_GATEWAY_URL: http://file-upload-service:3001
MINIO_REPLACEMENT_URL: ${MINIO_REPLACEMENT_URL}
SSE_EVENTS_URL: ${SSE_EVENTS_URL}
healthcheck:
test: ["CMD", "curl", "-f", "http://frontend:3000"]
interval: 30s
timeout: 10s
retries: 3
depends_on:
file-upload-service:
condition: service_started
file-processing-service:
condition: service_started
sse-server:
condition: service_started
nginx:
image: nginx:latest
container_name: nginx
ports:
- "81:80"
volumes:
- ./infrastructure/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
frontend:
condition: service_started