diff --git a/Makefile b/Makefile index 3c2961f3..400cfb83 100644 --- a/Makefile +++ b/Makefile @@ -101,3 +101,11 @@ $(binary_name): tmp/.linted.sentinel mservctl/mservctl: tmp/.linted.sentinel > cd mservctl > go build -mod=vendor + +# Start runs development environment with mserv and mongo in docker-compose +start: +> docker-compose up -d + +# Stop runs development environment with mserv and mongo in docker-compose +stop: +> docker-compose stop diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..302dfbbf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +--- +version: '3.8' + +services: + mongodb: + image: mongo:4.0 + restart: always + environment: + - AUTH=no + volumes: + - mongo-data:/data/db + ports: + - "27017:27017" + networks: + - tyk + + mserv: + build: . + restart: always + volumes: + - ./mserv_example.conf:/etc/mserv/mserv.json + depends_on: + - mongodb + ports: + - "8989:8989" + networks: + - tyk + +volumes: + mongo-data: + +networks: + tyk: diff --git a/mserv_example.conf b/mserv_example.conf index ae15d04b..21708003 100644 --- a/mserv_example.conf +++ b/mserv_example.conf @@ -12,7 +12,7 @@ }, "MongoStore": { "default": { - "ConnStr": "mongodb://localhost:27017/admin", + "ConnStr": "mongodb://mongodb:27017/admin", "UseTLS": false, "Crypto": { "Enabled": false,