Skip to content

Commit

Permalink
WIP: Add v4 changes (#37)
Browse files Browse the repository at this point in the history
* Add v4 changes

* Update docker-compose.yml

Co-authored-by: Sedky Abou-Shamalah <[email protected]>
  • Loading branch information
zalbiraw and sedkis authored Feb 18, 2022
1 parent 147a7a9 commit 3fd01ca
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 42 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ Open the `tyk_analytics.env` file in the `confs/` folder and add your license st
Run docker compose:

```
$ docker-compose up
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.`database_type`.yml up
```

`database_type`: can be `mongo` or `postgres`

Please note that this command may take a while to complete, as Docker needs to download and provision all of the containers.

This will run in non-daemonised mode so you can see all the output.
Expand All @@ -30,5 +32,5 @@ Open your browser to http://localhost:3000. You will be presented with the Boot

To delete all containers as well as remove all volumes from your host:
```
$ docker-compose down -v
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.`database_type`.yml down -v
```
14 changes: 0 additions & 14 deletions confs/pump.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,4 @@ TYK_PMP_ANALYTICSSTORAGECONFIG_MAXACTIVE=100
TYK_PMP_ANALYTICSSTORAGECONFIG_ENABLECLUSTER=false
TYK_PMP_PURGEDELAY=2

TYK_PMP_PUMPS_MONGO_TYPE=mongo
TYK_PMP_PUMPS_MONGO_META_COLLECTIONNAME=tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MAXINSERTBATCHSIZEBYTES=80000
TYK_PMP_PUMPS_MONGO_META_MAXDOCUMENTSIZEBYTES=20112

TYK_PMP_PUMPS_MONGOAGG_TYPE=mongo-pump-aggregate
TYK_PMP_PUMPS_MONGOAGG_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGOAGG_META_USEMIXEDCOLLECTION=true

TYK_PMP_UPTIMEPUMPCONFIG_COLLECTIONNAME=tyk_uptime_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MAXINSERTBATCHSIZEBYTES=500000
TYK_PMP_UPTIMEPUMPCONFIG_MAXDOCUMENTSIZEBYTES=200000
TYK_PMP_DONTPURGEUPTIMEDATA=false
14 changes: 14 additions & 0 deletions confs/pump.mongo.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
TYK_PMP_PUMPS_MONGO_TYPE=mongo
TYK_PMP_PUMPS_MONGO_META_COLLECTIONNAME=tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MAXINSERTBATCHSIZEBYTES=80000
TYK_PMP_PUMPS_MONGO_META_MAXDOCUMENTSIZEBYTES=20112

TYK_PMP_PUMPS_MONGOAGG_TYPE=mongo-pump-aggregate
TYK_PMP_PUMPS_MONGOAGG_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGOAGG_META_USEMIXEDCOLLECTION=true

TYK_PMP_UPTIMEPUMPCONFIG_COLLECTIONNAME=tyk_uptime_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MAXINSERTBATCHSIZEBYTES=500000
TYK_PMP_UPTIMEPUMPCONFIG_MAXDOCUMENTSIZEBYTES=200000
11 changes: 11 additions & 0 deletions confs/pump.postgres.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TYK_PMP_UPTIMEPUMPCONFIG_UPTIMETYPE=sql
TYK_PMP_UPTIMEPUMPCONFIG_TYPE=postgres
TYK_PMP_UPTIMEPUMPCONFIG_CONNECTIONSTRING=user=default password=topsecretpassword host=tyk-postgres port=5432 database=tyk_analytics

TYK_PMP_PUMPS_SQL_TYPE=SQL
TYK_PMP_PUMPS_SQL_META_TYPE=postgres
TYK_PMP_PUMPS_SQL_META_CONNECTIONSTRING=user=default password=topsecretpassword host=tyk-postgres port=5432 database=tyk_analytics

TYK_PMP_PUMPS_SQLAGGREGATE_TYPE=SQL
TYK_PMP_PUMPS_SQLAGGREGATE_META_TYPE=postgres
TYK_PMP_PUMPS_SQLAGGREGATE_META_CONNECTIONSTRING=user=default password=topsecretpassword host=tyk-postgres port=5432 database=tyk_analytics
3 changes: 0 additions & 3 deletions confs/tyk_analytics.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ TYK_DB_TYKAPI_PORT=8080
TYK_DB_TYKAPI_SECRET=352d20ee67be67f6340b4c0605b044b7
TYK_DB_NODESECRET=352d20ee67be67f6340b4c0605b044b7

### Dashboard DB Connection Details
TYK_DB_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics

### Redis Connection Details
TYK_DB_REDISADDRS=tyk-redis:6379
TYK_DB_REDISPASSWORD=
Expand Down
27 changes: 27 additions & 0 deletions docker-compose.mongo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.9'
services:
tyk-dashboard:
environment:
- TYK_DB_STORAGE_MAIN_TYPE=mongo
- TYK_DB_STORAGE_MAIN_CONNECTIONSTRING=mongodb://tyk-mongo:27017/tyk_analytics

tyk-pump:
env_file:
- ./confs/pump.mongo.env

tyk-mongo:
image: mongo:4.0
container_name: tyk-mongo

command: ["mongod", "--smallfiles"]
ports:
- "27017:27017"

volumes:
- mongo-data:/data/db

networks:
- tyk

volumes:
mongo-data:
31 changes: 31 additions & 0 deletions docker-compose.postgres.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.9'
services:
tyk-dashboard:
environment:
- TYK_DB_STORAGE_MAIN_TYPE=postgres
- TYK_DB_STORAGE_MAIN_CONNECTIONSTRING=user=default password=topsecretpassword host=tyk-postgres port=5432 database=tyk_analytics

tyk-pump:
env_file:
- ./confs/pump.postgres.env

tyk-postgres:
image: postgres:latest
container_name: tyk-postgres

environment:
- POSTGRES_DB=tyk_analytics
- POSTGRES_USER=default
- POSTGRES_PASSWORD=topsecretpassword

ports:
- "5432:5432"

volumes:
- postgres-data:/data/db

networks:
- tyk

volumes:
postgres-data:
37 changes: 14 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,45 @@
version: '3.3'
version: '3.9'
services:
tyk-dashboard:
image: tykio/tyk-dashboard:v3.2.2
image: tykio/tyk-dashboard:v4.0.0
container_name: tyk-dashboard
ports:
- "3000:3000"
- "3000:3000"
env_file:
- ./confs/tyk_analytics.env
- ./confs/tyk_analytics.env
networks:
- tyk
- tyk

tyk-gateway:
image: tykio/tyk-gateway:v3.2.2
image: tykio/tyk-gateway:v4.0.0
container_name: tyk-gateway
ports:
- "8080:8080"
volumes:
- ./middleware:/opt/tyk-gateway/middleware
- "8080:8080"
env_file:
- ./confs/tyk.env
- ./confs/tyk.env
networks:
- tyk
- tyk

tyk-pump:
image: tykio/tyk-pump-docker-pub:v1.5.1-rc2
image: tykio/tyk-pump-docker-pub:v1.5.1
container_name: tyk-pump
env_file:
- ./confs/pump.env
networks:
- tyk

tyk-redis:
image: redis
container_name: tyk-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- tyk

tyk-mongo:
image: mongo:4.0
command: ["mongod", "--smallfiles"]
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- tyk

volumes:
redis-data:
mongo-data:

networks:
tyk:

0 comments on commit 3fd01ca

Please sign in to comment.