Skip to content

Commit

Permalink
add docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
杨森 committed Feb 24, 2018
1 parent 5634f31 commit e04cf14
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 0 deletions.
83 changes: 83 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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

21 changes: 21 additions & 0 deletions minio.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
30 changes: 30 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit e04cf14

Please sign in to comment.