summaryrefslogtreecommitdiffstats
path: root/docker-compose
diff options
context:
space:
mode:
Diffstat (limited to 'docker-compose')
-rw-r--r--docker-compose/docker-compose.yaml25
-rw-r--r--docker-compose/nginx.conf34
2 files changed, 59 insertions, 0 deletions
diff --git a/docker-compose/docker-compose.yaml b/docker-compose/docker-compose.yaml
new file mode 100644
index 0000000..dbba825
--- /dev/null
+++ b/docker-compose/docker-compose.yaml
@@ -0,0 +1,25 @@
+version: '2'
+services:
+ storperf:
+ container_name: "storperf"
+ image: "opnfv/storperf:${TAG}"
+ ports:
+ - "8000:8000"
+ env_file: ${ENV_FILE}
+ volumes:
+ - ${CARBON_DIR}:/opt/graphite/storage/whisper
+
+ swagger-ui:
+ container_name: "swagger-ui"
+ image: "schickling/swagger-ui"
+
+ http-front-end:
+ container_name: "http-front-end"
+ image: nginx:stable-alpine
+ ports:
+ - "5000:5000"
+ volumes:
+ - ./nginx.conf:/etc/nginx/nginx.conf:ro
+ links:
+ - storperf
+ - swagger-ui \ No newline at end of file
diff --git a/docker-compose/nginx.conf b/docker-compose/nginx.conf
new file mode 100644
index 0000000..b7933ac
--- /dev/null
+++ b/docker-compose/nginx.conf
@@ -0,0 +1,34 @@
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ sendfile on;
+ keepalive_timeout 65;
+ proxy_send_timeout 600;
+ proxy_read_timeout 600;
+ send_timeout 600;
+
+ map $args $containsurl {
+ default 0;
+ "~(^|&)url=[^&]+($|&)" 1;
+ }
+
+ server {
+ listen 5000;
+
+ location /api/ {
+ proxy_pass http://storperf:5000;
+ proxy_set_header Host $host:$proxy_port;
+ }
+
+ location /swagger/ {
+ if ($containsurl = 0) {
+ return 302 $scheme://$host:$server_port$uri?url=http://$host:$server_port/api/spec.json$args;
+ }
+ proxy_pass http://swagger-ui:80/;
+ }
+ }
+}
+
+events {
+ worker_connections 1024;
+}