Skip to content

Commit b6f113a

Browse files
committed
[Docker] restore docker-compose files
1 parent 113a83d commit b6f113a

26 files changed

+2752
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
version: '3.3'
2+
3+
services:
4+
envoy:
5+
build:
6+
context: ./
7+
dockerfile: ./envoy.Dockerfile
8+
image: 'grpcweb:envoy'
9+
container_name: 'envoy'
10+
restart: always
11+
ports:
12+
- '8090:8090'
13+
- '9090:9090'
14+
- '9901:9901'
15+
command: ['/etc/envoy/envoy.yaml']
16+
depends_on:
17+
- yorkie
18+
# If you're using Mac or Windows, this special domain name("host.docker.internal" which makes containers able to connect to the host)
19+
# is supported by default.
20+
# But if you're using Linux and want an envoy container to communicate with the host,
21+
# it may help to define "hst.docker.internal" in extra_hosts.
22+
# (Actually, other hostnames are available, but in that case you should update clusters[].host configurations of envoy.yaml)
23+
extra_hosts:
24+
- "host.docker.internal:host-gateway"
25+
yorkie:
26+
image: 'yorkieteam/yorkie:latest'
27+
container_name: 'yorkie'
28+
command: [
29+
'server',
30+
'--mongo-connection-uri',
31+
'mongodb://mongo:27017',
32+
'--enable-pprof',
33+
]
34+
restart: always
35+
ports:
36+
- '11101:11101'
37+
- '11102:11102'
38+
- '11103:11103'
39+
prometheus:
40+
image: prom/prometheus:latest
41+
container_name: prometheus
42+
ports:
43+
- '9090:9090'
44+
command:
45+
- --config.file=/etc/prometheus/prometheus.yml
46+
volumes:
47+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
48+
grafana:
49+
image: grafana/grafana:latest
50+
container_name: grafana
51+
ports:
52+
- '3000:3000'
53+
depends_on:
54+
- prometheus
55+
etcd:
56+
image: bitnami/etcd:latest
57+
container_name: etcd
58+
environment:
59+
- ALLOW_NONE_AUTHENTICATION=yes
60+
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
61+
ports:
62+
- '2379:2379'
63+
- '2380:2380'
64+
mongo:
65+
image: mongo:latest
66+
container_name: mongo
67+
restart: always
68+
ports:
69+
- '27017:27017'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM envoyproxy/envoy:v1.19.0
2+
3+
COPY ./envoy.yaml /etc/envoy/envoy.yaml
4+
5+
ENTRYPOINT ["/usr/local/bin/envoy", "-c"]
6+
7+
CMD /etc/envoy/envoy.yaml
+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
admin:
2+
access_log_path: /tmp/admin_access.log
3+
address:
4+
socket_address: { address: 0.0.0.0, port_value: 9901 }
5+
6+
static_resources:
7+
listeners:
8+
- name: yorkie_listener
9+
address:
10+
socket_address: { address: 0.0.0.0, port_value: 8090 }
11+
filter_chains:
12+
- filters:
13+
- name: envoy.filters.network.http_connection_manager
14+
typed_config:
15+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
16+
stat_prefix: ingress_http
17+
route_config:
18+
name: local_route
19+
virtual_hosts:
20+
- name: local_service
21+
domains: ["*"]
22+
routes:
23+
- match: { prefix: "/" }
24+
route:
25+
cluster: yorkie_service
26+
# https://github.com/grpc/grpc-web/issues/361
27+
max_stream_duration:
28+
grpc_timeout_header_max: 0s
29+
cors:
30+
allow_origin_string_match:
31+
- prefix: "*"
32+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
33+
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout,authorization
34+
max_age: "1728000"
35+
expose_headers: custom-header-1,grpc-status,grpc-message, grpc-status-details-bin
36+
http_filters:
37+
- name: envoy.filters.http.grpc_web
38+
- name: envoy.filters.http.cors
39+
- name: envoy.filters.http.router
40+
- name: admin_listener
41+
address:
42+
socket_address: { address: 0.0.0.0, port_value: 9090 }
43+
filter_chains:
44+
- filters:
45+
- name: envoy.filters.network.http_connection_manager
46+
typed_config:
47+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
48+
stat_prefix: ingress_http
49+
route_config:
50+
name: local_route
51+
virtual_hosts:
52+
- name: local_service
53+
domains: ["*"]
54+
routes:
55+
- match: { prefix: "/" }
56+
route:
57+
cluster: admin_service
58+
# https://github.com/grpc/grpc-web/issues/361
59+
max_stream_duration:
60+
grpc_timeout_header_max: 0s
61+
cors:
62+
allow_origin_string_match:
63+
- prefix: "*"
64+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
65+
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout,authorization
66+
max_age: "1728000"
67+
expose_headers: custom-header-1,grpc-status,grpc-message, grpc-status-details-bin
68+
http_filters:
69+
- name: envoy.filters.http.grpc_web
70+
- name: envoy.filters.http.cors
71+
- name: envoy.filters.http.router
72+
clusters:
73+
- name: yorkie_service
74+
connect_timeout: 0.25s
75+
type: logical_dns
76+
http2_protocol_options: {}
77+
lb_policy: round_robin
78+
# Input the address which envoy can connect to as a yorkie server.
79+
# When you want envoy container to communicate with your host machine, you should set as the following
80+
# - Windows/Mac: Input host.docker.internal
81+
# - Linux: an IP address of the host machine or docker-0 interface or some addresses defined in extra hosts of docker-compose.yml
82+
# you can simply use the yorkie container name(e.g. yorkie) in docker-compose whatever your OS is.
83+
load_assignment:
84+
cluster_name: yorkie_cluster
85+
endpoints:
86+
- lb_endpoints:
87+
- endpoint:
88+
address:
89+
socket_address:
90+
address: host.docker.internal
91+
port_value: 11101
92+
- name: admin_service
93+
connect_timeout: 0.25s
94+
type: logical_dns
95+
http2_protocol_options: {}
96+
lb_policy: round_robin
97+
# Input the address which envoy can connect to as a yorkie server.
98+
# When you want envoy container to communicate with your host machine, you should set as the following
99+
# - Windows/Mac: Input host.docker.internal
100+
# - Linux: an IP address of the host machine or docker-0 interface or some addresses defined in extra hosts of docker-compose.yml
101+
# you can simply use the yorkie container name(e.g. yorkie) in docker-compose whatever your OS is.
102+
load_assignment:
103+
cluster_name: admin_cluster
104+
endpoints:
105+
- lb_endpoints:
106+
- endpoint:
107+
address:
108+
socket_address:
109+
address: host.docker.internal
110+
port_value: 11103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
scrape_configs:
2+
- job_name: yorkie
3+
metrics_path: /metrics
4+
scrape_interval: 5s
5+
static_configs:
6+
- targets:
7+
# win/mac hosts: Use address: host.docker.internal instead of address: localhost in the line below
8+
- host.docker.internal:11102

0 commit comments

Comments
 (0)