-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
112 lines (97 loc) · 3.02 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
version: '3'
services:
dockerhost:
image: qoomon/docker-host
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
restart: on-failure
kong-database:
image: postgres:9.5
environment:
- POSTGRES_USER=kong
- POSTGRES_DB=kong
- POSTGRES_PASSWORD=kong
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 5
kong-migration:
image: kong:2.1.2-centos
command: "sleep 10; kong migrations bootstrap ; kong migrations list ; kong migrations up"
restart: on-failure
environment:
KONG_PG_HOST: kong-database
KONG_PG_PASSWORD: kong
links:
- kong-database
depends_on:
- kong-database
kong:
image: kong:2.1.2-centos
depends_on:
- kong-database
environment:
- KONG_LUA_SSL_VERIFY_DEPTH=3
- KONG_LUA_SSL_TRUSTED_CERTIFICATE=/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt
- KONG_DATABASE=postgres
- KONG_PG_HOST=kong-database
- KONG_PG_PASSWORD=kong
- KONG_PROXY_ACCESS_LOG=/dev/stdout
- KONG_ADMIN_ACCESS_LOG=/dev/stdout
- KONG_PROXY_ERROR_LOG=/dev/stderr
- KONG_ADMIN_ERROR_LOG=/dev/stderr
- KONG_ADMIN_LISTEN=0.0.0.0:8001
- KONG_LOG_LEVEL=debug
- KONG_PLUGINS=bundled,${NAME}
- KONG_NGINX_HTTP_CLIENT_BODY_BUFFER_SIZE=1M
volumes:
- plugin-development:/plugin-development
user: "0:0"
command:
- /bin/bash
- -c
- |
sleep 12
mkdir -p /usr/local/lib/luarocks/rocks-5.1/${NAME}/${VERSION}/
ln -s /plugin-development/${NAME}-${VERSION}.rockspec /usr/local/lib/luarocks/rocks-5.1/${NAME}/${VERSION}/${NAME}-${VERSION}.rockspec
ln -s /plugin-development/src /usr/local/share/lua/5.1/kong/plugins/${NAME}
kong migrations bootstrap
kong migrations list
kong migrations up
/usr/local/bin/kong start --run-migrations --vv
ports:
- "8000:8000"
- "8001:8001"
localstack:
image: localstack/localstack
ports:
- "4566:4566"
environment:
- SERVICES=sns,sqs
- DEFAULT_REGION=us-east-1
setup-resources:
image: mesosphere/aws-cli
environment:
- AWS_ACCESS_KEY_ID=AKIAEXAMPLE123
- AWS_SECRET_ACCESS_KEY=AWSSECRETACCESSEY123
- AWS_DEFAULT_REGION=us-east-1
entrypoint: /bin/sh -c
command: >
"
sleep 20
# Executing SNS
aws sns create-topic --name local_sns --endpoint-url=http://localstack:4566
# Executing SQS
aws sqs create-queue --endpoint-url=http://localstack:4566 --queue-name local_queue;
# Subscribing to SNS to SQS
aws --endpoint-url=http://localstack:4566 sns subscribe --attributes RawMessageDelivery=true --topic-arn arn:aws:sns:us-east-1:000000000000:local_sns --protocol sqs --notification-endpoint http://localstack:4576/queue/local_queue
"
depends_on:
- localstack
volumes:
plugin-development:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/