-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
92 lines (89 loc) · 2.69 KB
/
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
# You need to generate certificates before any of this will work.
# See <repo root>/cert.
#
# client
# This is the client. It connects to pubsub.cloudapis.test which by docker
# magic is the "pubsub" service in this compose file
#
# server
# This is the server. It listens on port 50051. Because networks.main.aliases
# is set to pubsub.cloudapis.test and we have (hopefully) generated a certificate for *.cloudapis.net, the client should be able to create a
# TLS connection to this server. We run 3 replicas of the server and reproduce pretty quickly. I have seen it reproduce with one replica before.
#
# docker compose up --build should get this going
# `docker compose exec client bash` should get you a shell on the client container
#
# Here's my docker version:
#
# % docker version
# Client: Docker Engine - Community
# Version: 24.0.5
# API version: 1.43
# Go version: go1.20.6
# Git commit: ced0996
# Built: Fri Jul 21 20:37:15 2023
# OS/Arch: linux/amd64
# Context: default
#
# Server: Docker Engine - Community
# Engine:
# Version: 24.0.5
# API version: 1.43 (minimum version 1.12)
# Go version: go1.20.6
# Git commit: a61e2b4
# Built: Fri Jul 21 20:35:40 2023
# OS/Arch: linux/amd64
# Experimental: false
# containerd:
# Version: 1.6.22
# GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca
# runc:
# Version: 1.1.8
# GitCommit: v1.1.8-0-g82f18fe
# docker-init:
# Version: 0.19.0
# GitCommit: de40ad0
services:
client:
build: ./client
environment:
APP_CACERT: "/etc/ssl/certs/ca-cert.pem"
APP_GCP_PROJECT_ID: "fake-gcp-project-id"
APP_PUBSUB_TOPIC_NAME: "fake-topic-name"
APP_PERIOD_MS: "10000"
APP_DELAY_MS: "500"
APP_SERVICE_PATH: "pubsub.cloudapis.test"
GRPC_TRACE: "transport,transport_flowctrl"
GRPC_VERBOSITY: "debug"
configs:
- source: ca-cert
target: /etc/ssl/certs/ca-cert.pem
networks:
- main
server:
build: ./server
deploy:
replicas: 3
environment:
APP_PORT: "50051"
APP_CONNECTION_TIMEOUT: "1ms"
APP_SERVER_CERT: "/etc/ssl/certs/server-cert.pem"
APP_SERVER_KEY: "/etc/ssl/private/server-key.pem"
configs:
- source: server-cert
target: /etc/ssl/certs/server-cert.pem
- source: server-key
target: /etc/ssl/private/server-key.pem
networks:
main:
aliases:
- pubsub.cloudapis.test
configs:
ca-cert:
file: "./cert/ca-cert.pem"
server-cert:
file: "./cert/server-cert.pem"
server-key:
file: "./cert/server-key.pem"
networks:
main: