Skip to content

Commit

Permalink
split deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Nov 14, 2020
1 parent 9327a2b commit dc66b83
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,14 @@ UUID: @fake(:uuid_digit)
Clone and then run docker containers.

```zsh
# Simple setup
$ git clone https://github.com/Clivern/Rhino.git
$ cd Rhino/deployment/docker-compose
$ cd Rhino/deployment/basic/docker-compose
$ docker-compose up -d

# In case you want to visualize incoming requests with grafana
$ git clone https://github.com/Clivern/Rhino.git
$ cd Rhino/deployment/advanced/docker-compose
$ docker-compose up -d
```

Expand Down
67 changes: 67 additions & 0 deletions deployment/advanced/docker-compose/configs/config.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"app": {
"mode": "prod",
"port": "8080",
"domain": "http://127.0.0.1:8080",
"tls": {
"status": "off",
"pemPath": "/cert/server.pem",
"keyPath": "/cert/server.key"
}
},
"mock": [
{
"path": "/api/v2/service1/mock/:id",
"request": {
"method": "get",
"parameters": {}
},
"response": {
"statusCode": 200,
"headers": [
{"key": "Content-Type", "value": "application/json"}
],
"body": "{\"id\": \":id\"}"
},
"chaos": {
"latency": "0s",
"failRate": "0%"
}
},
{
"path": "/api/v2/service2/mock/:id",
"request": {
"method": "get",
"parameters": {
"var_param": ":var_param",
"fixed_param": 10
}
},
"response": {
"statusCode": 200,
"headers": [
{"key": "Content-Type", "value": "application/json"}
],
"body": "@json:/app/configs/service2.getItem.response.json"
},
"chaos": {
"latency": "0s",
"failRate": "0%"
}
}
],
"debug": [
{
"path": "/api/v2/service/debug",
"chaos": {
"latency": "0s",
"failRate": "0%"
}
}
],
"log": {
"level": "info",
"output": "/app/configs/prod.log",
"format": "json"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3'

services:
rhino:
image: 'clivern/rhino:release-1.5.0'
Expand All @@ -9,6 +10,22 @@ services:
- './configs/:/app/configs'
restart: unless-stopped

loki:
image: grafana/loki:2.0.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
networks:
- loki

promtail:
image: grafana/promtail:2.0.0
volumes:
- './configs/:/var/log'
command: -config.file=/etc/promtail/config.yml
networks:
- loki

prometheus:
image: 'prom/prometheus:v2.22.1'
volumes:
Expand All @@ -29,3 +46,9 @@ services:
depends_on:
- prometheus
restart: unless-stopped
networks:
- loki


networks:
loki:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":":id","var_param":":var_param"}
11 changes: 11 additions & 0 deletions deployment/basic/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'

services:
rhino:
image: 'clivern/rhino:release-1.5.0'
ports:
- "8080:8080"
command: '/app/rhino serve -c /app/configs/config.prod.json'
volumes:
- './configs/:/app/configs'
restart: unless-stopped

0 comments on commit dc66b83

Please sign in to comment.