Skip to content

Commit

Permalink
Update default config (#39)
Browse files Browse the repository at this point in the history
* Update default config

* Streamline volumes
  • Loading branch information
zalbiraw authored Mar 7, 2022
1 parent 10ed977 commit 76f1c5a
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 52 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ Open the `tyk_analytics.env` file in the `confs/` folder and add your license st

Run docker compose:

With a `Mongo` database:
```
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.`database_type`.yml up
$ docker-compose up
```

`database_type`: can be `mongo` or `postgres`
With a `PostgreSQL` database:
```
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.postgres.yml up
```

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

Expand All @@ -28,9 +32,16 @@ Bootstrap the instance:

Open your browser to http://localhost:3000. You will be presented with the Bootstrap UI to create your first organisation and admin user.

## Bringing down
## Tear down

To delete all containers as well as remove all volumes from your host:

Mongo:
```
$ docker-compose down -v
```

PostgreSQL:
```
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.`database_type`.yml down -v
$ docker-compose -f ./docker-compose.yml -f ./docker-compose.postgres.yml down -v
```
16 changes: 8 additions & 8 deletions confs/pump.mongo.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
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_MAIN_TYPE=mongo
TYK_PMP_PUMPS_MAIN_META_COLLECTIONNAME=tyk_analytics
TYK_PMP_PUMPS_MAIN_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MAIN_META_MAXINSERTBATCHSIZEBYTES=80000
TYK_PMP_PUMPS_MAIN_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_PUMPS_MAINAGG_TYPE=mongo-pump-aggregate
TYK_PMP_PUMPS_MAINAGG_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MAINAGG_META_USEMIXEDCOLLECTION=true

TYK_PMP_UPTIMEPUMPCONFIG_COLLECTIONNAME=tyk_uptime_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
Expand Down
18 changes: 9 additions & 9 deletions confs/pump.postgres.env
Original file line number Diff line number Diff line change
@@ -1,11 +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_MAIN_TYPE=SQL
TYK_PMP_PUMPS_MAIN_META_TYPE=postgres
TYK_PMP_PUMPS_MAIN_META_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_MAINAGG_TYPE=SQL
TYK_PMP_PUMPS_MAINAGG_META_TYPE=postgres
TYK_PMP_PUMPS_MAINAGG_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
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
27 changes: 0 additions & 27 deletions docker-compose.mongo.yml

This file was deleted.

9 changes: 5 additions & 4 deletions docker-compose.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ services:
- "5432:5432"

volumes:
- postgres-data:/data/db
- db-data:/data/db

networks:
- tyk

volumes:
postgres-data:

tyk-mongo:
entrypoint: ["echo", "Docker Mongo service disabled. Using Postgres service instead.", ""]
command: []
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ services:
tyk-dashboard:
image: tykio/tyk-dashboard:v4.0.0
container_name: tyk-dashboard
environment:
- TYK_DB_STORAGE_MAIN_TYPE=mongo
- TYK_DB_STORAGE_MAIN_CONNECTIONSTRING=mongodb://tyk-mongo:27017/tyk_analytics
ports:
- "3000:3000"
env_file:
Expand All @@ -25,6 +28,7 @@ services:
container_name: tyk-pump
env_file:
- ./confs/pump.env
- ./confs/pump.mongo.env
networks:
- tyk

Expand All @@ -37,9 +41,24 @@ services:
- redis-data:/data
networks:
- tyk

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

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

volumes:
- db-data:/data/db

networks:
- tyk

volumes:
redis-data:
db-data:

networks:
tyk:

0 comments on commit 76f1c5a

Please sign in to comment.