-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
165 lines (158 loc) · 4.26 KB
/
docker-compose.yaml
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
version: "3.7"
services:
### POSTGRES ###
postgresql:
image: docker.io/library/postgres:12
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: app
POSTGRES_PASSWORD: supersecret
POSTGRES_USER: postgres
command:
- docker-entrypoint.sh
- postgres
- -c
- 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- type: bind
source: ./postgres/pgdata
target: /var/lib/postgresql/data/pgdata
- type: bind
source: ./postgresql/run
target: /var/run/postgresql
- type: bind
source: ./postgresql/postgres.conf
target: /etc/postgresql/postgresql.conf
user: "1000"
ports:
- "127.0.0.1:5432:5432"
wal-listener:
image: docker.io/theaxer/wal-listener:v1.2.0-5-g66dbbab
command:
- "./wal-listener"
- "-c"
- "/app/config.yml"
volumes:
- type: bind
source: ./wal_listener/config.yml
target: /app/config.yml
depends_on:
- postgresql
- nats
connector:
image: ghcr.io/openfaas/nats-connector:latest
environment:
gateway_url: http://gateway:8080
topics: "sample_app,"
print_response: "true"
basic_auth: "true"
asynchronous_invocation: "false"
secret_mount_path: "/run/secrets/"
volumes:
# we assume cwd == /var/lib/faasd
- type: bind
source: ./secrets/basic-auth-password
target: /run/secrets/basic-auth-password
- type: bind
source: ./secrets/basic-auth-user
target: /run/secrets/basic-auth-user
cap_add:
- CAP_NET_RAW
depends_on:
- nats
- gateway
### CORE SERVICES BELOW ###
basic-auth-plugin:
image: ghcr.io/openfaas/basic-auth:0.20.5
environment:
- port=8080
- secret_mount_path=/run/secrets
- user_filename=basic-auth-user
- pass_filename=basic-auth-password
volumes:
# we assume cwd == /var/lib/faasd
- type: bind
source: ./secrets/basic-auth-password
target: /run/secrets/basic-auth-password
- type: bind
source: ./secrets/basic-auth-user
target: /run/secrets/basic-auth-user
cap_add:
- CAP_NET_RAW
nats:
image: docker.io/library/nats-streaming:0.11.2
command:
- "/nats-streaming-server"
- "-m"
- "8222"
- "--store=memory"
- "--cluster_id=faas-cluster"
- "-DV"
ports:
- "127.0.0.1:8222:8222"
- "127.0.0.1:4222:4222"
prometheus:
image: docker.io/prom/prometheus:v2.14.0
volumes:
- type: bind
source: ./prometheus.yml
target: /etc/prometheus/prometheus.yml
cap_add:
- CAP_NET_RAW
ports:
- "127.0.0.1:9090:9090"
gateway:
image: ghcr.io/openfaas/gateway:0.20.5
environment:
- basic_auth=true
- functions_provider_url=http://faasd-provider:8081/
- direct_functions=false
- read_timeout=60s
- write_timeout=60s
- upstream_timeout=65s
- faas_nats_address=nats
- faas_nats_port=4222
- auth_proxy_url=http://basic-auth-plugin:8080/validate
- auth_proxy_pass_body=false
- secret_mount_path=/run/secrets
- scale_from_zero=true
volumes:
# we assume cwd == /var/lib/faasd
- type: bind
source: ./secrets/basic-auth-password
target: /run/secrets/basic-auth-password
- type: bind
source: ./secrets/basic-auth-user
target: /run/secrets/basic-auth-user
cap_add:
- CAP_NET_RAW
depends_on:
- basic-auth-plugin
- nats
- prometheus
ports:
- "8080:8080"
queue-worker:
image: docker.io/openfaas/queue-worker:0.11.2
environment:
- faas_nats_address=nats
- faas_nats_port=4222
- gateway_invoke=true
- faas_gateway_address=gateway
- ack_wait=5m5s
- max_inflight=1
- write_debug=false
- basic_auth=true
- secret_mount_path=/run/secrets
volumes:
# we assume cwd == /var/lib/faasd
- type: bind
source: ./secrets/basic-auth-password
target: /run/secrets/basic-auth-password
- type: bind
source: ./secrets/basic-auth-user
target: /run/secrets/basic-auth-user
cap_add:
- CAP_NET_RAW
depends_on:
- nats