Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (160 loc) · 4.8 KB
/
Copy pathdocker-compose.yml
File metadata and controls
171 lines (160 loc) · 4.8 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
167
168
169
170
171
services:
postgres:
image: postgres:15-alpine
container_name: streamsphere-postgres
ports:
- "${DB_PORT}:5432"
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
zookeeper:
image: confluentinc/cp-zookeeper:7.4.0
container_name: streamsphere-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: ${ZOOKEEPER_PORT}
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.4.0
container_name: streamsphere-kafka
depends_on:
- zookeeper
ports:
- "${KAFKA_PORT}:${KAFKA_PORT}"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:${ZOOKEEPER_PORT}
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:${KAFKA_INTERNAL_PORT},PLAINTEXT_HOST://localhost:${KAFKA_PORT}
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
minio:
image: minio/minio
container_name: streamsphere-minio
ports:
- "${MINIO_PORT}:9000"
- "${MINIO_CONSOLE_PORT}:9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
redis:
image: redis:7-alpine
container_name: streamsphere-redis
ports:
- "${REDIS_PORT}:6379"
zipkin:
image: openzipkin/zipkin
container_name: streamsphere-zipkin
ports:
- "9411:9411"
eureka-server:
build:
context: ./eureka-server
network: host
image: eureka-server
container_name: eureka-server
ports:
- "${EUREKA_PORT}:${EUREKA_PORT}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${EUREKA_PORT}/actuator/health"]
interval: 15s
timeout: 10s
retries: 10
start_period: 30s
api-gateway:
build:
context: ./api-gateway
network: host
image: api-gateway
container_name: api-gateway
ports:
- "${GATEWAY_PORT}:8080"
depends_on:
eureka-server:
condition: service_healthy
environment:
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: ${EUREKA_ZONE}
APP_CORS_ALLOWED_ORIGINS: ${APP_CORS_ALLOWED_ORIGINS}
ZIPKIN_URL: http://zipkin:9411/api/v2/spans
auth-service:
build:
context: ./auth-service
network: host
image: auth-service
container_name: auth-service
ports:
- "${AUTH_SERVICE_PORT}:8081"
depends_on:
eureka-server:
condition: service_healthy
redis:
condition: service_started
environment:
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: ${EUREKA_ZONE}
SPRING_DATA_REDIS_HOST: redis
SPRING_DATA_REDIS_PORT: 6379
APP_CORS_ALLOWED_ORIGINS: ${APP_CORS_ALLOWED_ORIGINS}
ZIPKIN_URL: http://zipkin:9411/api/v2/spans
user-service:
build:
context: ./user-service
network: host
image: user-service
container_name: user-service
ports:
- "${USER_SERVICE_PORT}:8082"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8082/actuator/health"]
interval: 15s
timeout: 10s
retries: 10
start_period: 30s
depends_on:
eureka-server:
condition: service_healthy
postgres:
condition: service_started
environment:
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: ${EUREKA_ZONE}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${DB_NAME}
SPRING_DATASOURCE_USERNAME: ${DB_USER}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
APP_CORS_ALLOWED_ORIGINS: ${APP_CORS_ALLOWED_ORIGINS}
ZIPKIN_URL: http://zipkin:9411/api/v2/spans
video-service:
build:
context: ./video-service
network: host
image: video-service
container_name: video-service
ports:
- "${VIDEO_SERVICE_PORT}:8083"
depends_on:
eureka-server:
condition: service_healthy
postgres:
condition: service_started
kafka:
condition: service_started
minio:
condition: service_started
environment:
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: ${EUREKA_ZONE}
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${DB_NAME}
SPRING_DATASOURCE_USERNAME: ${DB_USER}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:${KAFKA_INTERNAL_PORT}
MINIO_URL: http://minio:9000
MINIO_ACCESS_KEY: ${MINIO_ROOT_USER}
MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
APP_CORS_ALLOWED_ORIGINS: ${APP_CORS_ALLOWED_ORIGINS}
ZIPKIN_URL: http://zipkin:9411/api/v2/spans
volumes:
postgres_data:
minio_data: