From e04cf143995245f63d0cfbf63a4cbeee67667d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A3=AE?= Date: Sat, 24 Feb 2018 14:45:52 +0800 Subject: [PATCH] add docker-compose.yml --- docker-compose.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++++ minio.conf | 21 ++++++++++++ nginx.conf | 30 +++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 docker-compose.yml create mode 100644 minio.conf create mode 100644 nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c1e99a0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,83 @@ +version: '2' +# starts 4 docker containers running minio server instances. Each minio server's web interface will be accessible on the host at port 9001 through 9004. +services: + minio1: + image: minio/minio + volumes: + - data1:/data + ports: + - "9001:9000" + environment: + MINIO_ACCESS_KEY: 5J9Q0SRX2HJR2E5HCE8B + MINIO_SECRET_KEY: cFHCDKL73Dzc9fgV6Lh7Bb/8tmTztKPr3jp9pG3D + networks: + - minio-net + command: server http://minio1/data http://minio2/data http://minio3/data http://minio4/data + + minio2: + image: minio/minio + volumes: + - data2:/data + ports: + - "9002:9000" + environment: + MINIO_ACCESS_KEY: 5J9Q0SRX2HJR2E5HCE8B + MINIO_SECRET_KEY: cFHCDKL73Dzc9fgV6Lh7Bb/8tmTztKPr3jp9pG3D + networks: + - minio-net + command: server http://minio1/data http://minio2/data http://minio3/data http://minio4/data + + minio3: + image: minio/minio + volumes: + - data3:/data + ports: + - "9003:9000" + environment: + MINIO_ACCESS_KEY: 5J9Q0SRX2HJR2E5HCE8B + MINIO_SECRET_KEY: cFHCDKL73Dzc9fgV6Lh7Bb/8tmTztKPr3jp9pG3D + networks: + - minio-net + command: server http://minio1/data http://minio2/data http://minio3/data http://minio4/data + + minio4: + image: minio/minio + volumes: + - data4:/data + ports: + - "9004:9000" + environment: + MINIO_ACCESS_KEY: 5J9Q0SRX2HJR2E5HCE8B + MINIO_SECRET_KEY: cFHCDKL73Dzc9fgV6Lh7Bb/8tmTztKPr3jp9pG3D + networks: + - minio-net + command: server http://minio1/data http://minio2/data http://minio3/data http://minio4/data + + minio_nginx: + image: nginx:1.13.9-alpine + restart: always + ports: + - 9000:80/tcp + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./minio.conf:/etc/nginx/conf.d/default.conf:ro + links: + - minio1 + - minio2 + - minio3 + - minio4 + networks: + - minio-net + +## By default this config uses default local driver, +## For custom volumes replace with volume driver configuration. +volumes: + data1: + data2: + data3: + data4: + +networks: + minio-net: + driver: bridge + diff --git a/minio.conf b/minio.conf new file mode 100644 index 0000000..4576c5a --- /dev/null +++ b/minio.conf @@ -0,0 +1,21 @@ +upstream minio_server { + server minio1:9000; + server minio1:9000; + server minio1:9000; + server minio1:9000; + #least_conn; +} + + +server { + listen 80; + server_name minio; + + location / { + proxy_buffering off; + proxy_set_header Host $host; + proxy_pass http://minio_server; + proxy_read_timeout 90; + proxy_http_version 1.1; + } +} \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..b9282a9 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,30 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; + multi_accept on; + use epoll; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + client_max_body_size 1000m; + gzip on; + server_tokens off; + open_file_cache max=100; + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file