├── rails-nginx-unicorn ├── Procfile ├── unicorn.rb ├── nginx-sites.conf ├── Dockerfile └── README.md ├── fluentd-es ├── run.sh ├── td-agent.conf ├── README.md └── Dockerfile ├── rails-nginx-unicorn-pro ├── Procfile ├── unicorn.rb ├── nginx-sites.conf ├── Dockerfile └── README.md ├── ruby ├── CHANGELOG.md ├── README.md └── Dockerfile ├── README.md ├── kibana ├── README.md ├── Dockerfile ├── setup_configs.sh └── kibana.yml ├── elasticsearch ├── elasticsearch.yml ├── Dockerfile └── README.md ├── .gitignore └── LICENSE /rails-nginx-unicorn/Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec unicorn -c config/unicorn.rb 2 | nginx: /usr/sbin/nginx -c /etc/nginx/nginx.conf -------------------------------------------------------------------------------- /fluentd-es/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i -e "s/\%ES_HOSTS\%/${ES_HOSTS}/" /etc/td-agent/td-agent.conf 4 | /usr/sbin/td-agent "$@" -------------------------------------------------------------------------------- /rails-nginx-unicorn-pro/Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec unicorn -c config/unicorn.rb 2 | nginx: /usr/sbin/nginx -c /etc/nginx/nginx.conf -------------------------------------------------------------------------------- /ruby/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2019-02-03 4 | ### Added 5 | - Ruby 2.6.1 published `seapy/ruby:2.6.1` 6 | 7 | ### Changed 8 | - Using base image from `ubuntu:16.04` to `ubuntu:18.04` 9 | -------------------------------------------------------------------------------- /rails-nginx-unicorn-pro/unicorn.rb: -------------------------------------------------------------------------------- 1 | app_dir = "/app" 2 | 3 | working_directory app_dir 4 | 5 | pid "#{app_dir}/tmp/unicorn.pid" 6 | 7 | worker_processes 1 8 | listen "/tmp/unicorn.sock", :backlog => 64 9 | timeout 30 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What's include 2 | 3 | * seapy/ruby 4 | * ruby, bundler, git, curl, wget 5 | * seapy/rails-nginx-unicorn 6 | * unicorn, nginx, foreman 7 | * seapy/rails-nginx-unicorn-pro 8 | * unicorn, nginx, foreman 9 | * seapy/kibana 10 | * seapy/elasticsearch 11 | * seapy/fluentd-es 12 | -------------------------------------------------------------------------------- /kibana/README.md: -------------------------------------------------------------------------------- 1 | # kibana 2 | 3 | * java 8 4 | 5 | # Usage 6 | 7 | ```shell 8 | $ docker run -d -p 5601:5601 \ 9 | -e ES_URL=http://192.168.59.103:9200 \ 10 | seapy/kibana:4.0.1 11 | ``` 12 | 13 | # How to build 14 | 15 | ```shell 16 | $ docker build -t seapy/kibana:4.0.1 . 17 | ``` 18 | -------------------------------------------------------------------------------- /rails-nginx-unicorn/unicorn.rb: -------------------------------------------------------------------------------- 1 | app_dir = "/app" 2 | 3 | working_directory app_dir 4 | 5 | pid "#{app_dir}/tmp/unicorn.pid" 6 | 7 | stderr_path "#{app_dir}/log/unicorn.stderr.log" 8 | stdout_path "#{app_dir}/log/unicorn.stdout.log" 9 | 10 | worker_processes 1 11 | listen "/tmp/unicorn.sock", :backlog => 64 12 | timeout 30 -------------------------------------------------------------------------------- /elasticsearch/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | cluster.name: elastic_docker 2 | 3 | # path 4 | path.conf: /elasticsearch/config 5 | path.data: /data/mnt/data 6 | path.logs: /data/mnt/log 7 | path.plugins: /elasticsearch/plugins 8 | path.work: /data/mnt/work 9 | 10 | # index option 11 | index.number_of_shards: 5 12 | index.number_of_replicas: 1 -------------------------------------------------------------------------------- /ruby/README.md: -------------------------------------------------------------------------------- 1 | # Ruby Dockerfile 2 | 3 | ## What's include 4 | 5 | # Usage 6 | 7 | * Create `Dockerfile` to your project and paste below code. 8 | 9 | ``` 10 | # Dockerfile 11 | FROM seapy/ruby:2.5.1 12 | ``` 13 | 14 | # For Me 15 | 16 | ``` 17 | $ docker build -t seapy/ruby:2.6.1 . 18 | $ docker login 19 | $ docker push seapy/ruby:2.6.1 20 | ``` 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.rbc 3 | /.config 4 | /coverage/ 5 | /InstalledFiles 6 | /pkg/ 7 | /spec/reports/ 8 | /test/tmp/ 9 | /test/version_tmp/ 10 | /tmp/ 11 | 12 | ## Specific to RubyMotion: 13 | .dat* 14 | .repl_history 15 | build/ 16 | 17 | ## Documentation cache and generated files: 18 | /.yardoc/ 19 | /_yardoc/ 20 | /doc/ 21 | /rdoc/ 22 | 23 | ## Environment normalisation: 24 | /.bundle/ 25 | /lib/bundler/man/ 26 | 27 | # for a library or gem, you might want to ignore these files since the code is 28 | # intended to run in multiple environments; otherwise, check them in: 29 | # Gemfile.lock 30 | # .ruby-version 31 | # .ruby-gemset 32 | 33 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 34 | .rvmrc 35 | -------------------------------------------------------------------------------- /kibana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dockerfile/java:oracle-java8 2 | 3 | ENV KIBANA_PKG_NAME kibana-4.0.1-linux-x64 4 | 5 | RUN \ 6 | cd /tmp && \ 7 | wget https://download.elasticsearch.org/kibana/kibana/$KIBANA_PKG_NAME.tar.gz && \ 8 | tar xvzf $KIBANA_PKG_NAME.tar.gz && \ 9 | mv /tmp/$KIBANA_PKG_NAME /kibana 10 | 11 | ENV KIBANA_PORT 5601 12 | ENV KIBANA_HOST 0.0.0.0 13 | ENV ES_URL http://example.es.com:9200 14 | ENV KIBANA_INDEX .kibana 15 | ENV APP_ID discover 16 | ENV REQUEST_TIMEOUT 300000 17 | ENV SHARD_TIMEOUT 0 18 | ENV VERIFY_SSL false 19 | 20 | ADD kibana.yml /kibana/config/kibana.yml 21 | ADD ./setup_configs.sh /kibana/setup_configs.sh 22 | RUN chmod +x /kibana/setup_configs.sh 23 | 24 | WORKDIR /kibana 25 | EXPOSE 5601 26 | CMD ./setup_configs.sh && /kibana/bin/kibana -------------------------------------------------------------------------------- /kibana/setup_configs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i -e "\#::KIBANA_HOST::# s#::KIBANA_HOST::#${KIBANA_HOST}#g" /kibana/config/kibana.yml 4 | sed -i -e "\#::KIBANA_PORT::# s#::KIBANA_PORT::#${KIBANA_PORT}#g" /kibana/config/kibana.yml 5 | sed -i -e "\#::ES_URL::# s#::ES_URL::#${ES_URL}#g" /kibana/config/kibana.yml 6 | sed -i -e "\#::KIBANA_INDEX::# s#::KIBANA_INDEX::#${KIBANA_INDEX}#g" /kibana/config/kibana.yml 7 | sed -i -e "\#::APP_ID::# s#::APP_ID::#${APP_ID}#g" /kibana/config/kibana.yml 8 | sed -i -e "\#::REQUEST_TIMEOUT::# s#::REQUEST_TIMEOUT::#${REQUEST_TIMEOUT}#g" /kibana/config/kibana.yml 9 | sed -i -e "\#::SHARD_TIMEOUT::# s#::SHARD_TIMEOUT::#${SHARD_TIMEOUT}#g" /kibana/config/kibana.yml 10 | sed -i -e "\#::VERIFY_SSL::# s#::VERIFY_SSL::#${VERIFY_SSL}#g" /kibana/config/kibana.yml 11 | -------------------------------------------------------------------------------- /fluentd-es/td-agent.conf: -------------------------------------------------------------------------------- 1 | 2 | type tail 3 | format json 4 | time_key time 5 | path /var/lib/docker/containers/*/*-json.log 6 | pos_file /var/lib/docker/containers/containers.log.pos 7 | time_format %Y-%m-%dT%H:%M:%S 8 | tag container.* 9 | 10 | 11 | 12 | type hostname 13 | key_name docker_host 14 | add_prefix hostname 15 | 16 | 17 | 18 | type elasticsearch 19 | include_tag_key true 20 | hosts %ES_HOSTS% 21 | logstash_format true 22 | logstash_prefix container 23 | 24 | # buffer 25 | buffer_type file 26 | buffer_path /var/lib/docker/fluentd/buffer/container.*.buffer 27 | buffer_chunk_limit 8m 28 | buffer_queue_limit 10000 29 | retry_limit 17 30 | flush_interval 5 31 | -------------------------------------------------------------------------------- /fluentd-es/README.md: -------------------------------------------------------------------------------- 1 | # fluentd-es 2 | 3 | Docker containers log to elsticsearch using fluentd 4 | 5 | All containers log send to elaticsearch(/var/lib/docker/containers/*/*-json.log) 6 | 7 | * installed fluentd(actually td-agent) by apt-get 8 | * installed fluentd-elasticsearch plugin 9 | * change user `td-agent` to `root` 10 | 11 | ## How To Run 12 | 13 | ``` 14 | $ docker run -d \ 15 | --name fluentd-es \ 16 | -v /var/lib/docker:/var/lib/docker \ 17 | -e ES_HOSTS=192.168.0.1:9200,192.168.0.2:9200 \ 18 | seapy/fluentd-es 19 | ``` 20 | 21 | ## Build & Push 22 | 23 | ``` 24 | $ docker build -t seapy/fluentd-es . 25 | $ docker push seapy/fluentd-es 26 | ``` 27 | 28 | ## Refrence 29 | 30 | * kubernetes logging 31 | * https://github.com/GoogleCloudPlatform/kubernetes/blob/master/contrib/logging/fluentd-es-image/Dockerfile -------------------------------------------------------------------------------- /ruby/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | MAINTAINER ChangHoon Jeong 3 | 4 | RUN apt-get update 5 | 6 | # Install ruby dependencies 7 | RUN apt-get install -y wget curl \ 8 | build-essential git git-core \ 9 | zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev 10 | 11 | RUN apt-get update 12 | 13 | # Install ruby-install 14 | RUN cd /tmp &&\ 15 | wget -O ruby-install-0.7.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz &&\ 16 | tar -xzvf ruby-install-0.7.0.tar.gz &&\ 17 | cd ruby-install-0.7.0/ &&\ 18 | make install 19 | 20 | # Install MRI Ruby 21 | RUN ruby-install ruby 2.6.1 22 | 23 | # Add Ruby binaries to $PATH 24 | ENV PATH /opt/rubies/ruby-2.6.1/bin:$PATH 25 | 26 | # Add options to gemrc 27 | RUN echo "install: --no-document\nupdate: --no-document" > ~/.gemrc 28 | -------------------------------------------------------------------------------- /rails-nginx-unicorn/nginx-sites.conf: -------------------------------------------------------------------------------- 1 | upstream unicorn_server { 2 | server unix:/tmp/unicorn.sock fail_timeout=0; 3 | } 4 | 5 | server { 6 | listen 80; 7 | 8 | root /app/public; 9 | try_files $uri @unicorn_server; 10 | 11 | location @unicorn_server { 12 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 13 | proxy_set_header Host $http_host; 14 | #proxy_set_header X-Forwarded-Proto https; # if use ssl 15 | proxy_redirect off; 16 | proxy_pass http://unicorn_server; 17 | } 18 | 19 | location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ { 20 | gzip_static on; 21 | expires max; 22 | add_header Cache-Control public; 23 | add_header Last-Modified ""; 24 | add_header ETag ""; 25 | 26 | open_file_cache max=1000 inactive=500s; 27 | open_file_cache_valid 600s; 28 | open_file_cache_errors on; 29 | break; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rails-nginx-unicorn-pro/nginx-sites.conf: -------------------------------------------------------------------------------- 1 | upstream unicorn_server { 2 | server unix:/tmp/unicorn.sock fail_timeout=0; 3 | } 4 | 5 | server { 6 | listen 80; 7 | 8 | root /app/public; 9 | try_files $uri @unicorn_server; 10 | 11 | location @unicorn_server { 12 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 13 | proxy_set_header Host $http_host; 14 | #proxy_set_header X-Forwarded-Proto https; # if use ssl 15 | proxy_redirect off; 16 | proxy_pass http://unicorn_server; 17 | } 18 | 19 | location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ { 20 | gzip_static on; 21 | expires max; 22 | add_header Cache-Control public; 23 | add_header Last-Modified ""; 24 | add_header ETag ""; 25 | 26 | open_file_cache max=1000 inactive=500s; 27 | open_file_cache_valid 600s; 28 | open_file_cache_errors on; 29 | break; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rails-nginx-unicorn-pro/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM seapy/ruby:2.3.0 2 | MAINTAINER ChangHoon Jeong 3 | 4 | RUN apt-get update 5 | 6 | # Install nodejs 7 | RUN apt-get install -qq -y nodejs 8 | 9 | # Intall software-properties-common for add-apt-repository 10 | RUN apt-get install -qq -y software-properties-common 11 | 12 | # Install Nginx. 13 | RUN add-apt-repository -y ppa:nginx/stable 14 | RUN apt-get update 15 | RUN apt-get install -qq -y nginx=1.8.1-1+trusty0 16 | RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf 17 | RUN chown -R www-data:www-data /var/lib/nginx 18 | # Add default nginx config 19 | ADD nginx-sites.conf /etc/nginx/sites-enabled/default 20 | 21 | # Install foreman 22 | RUN gem install foreman 23 | 24 | # Rails App directory 25 | WORKDIR /app 26 | 27 | # Add default unicorn config 28 | ADD unicorn.rb /app/config/unicorn.rb 29 | 30 | # Add default foreman config 31 | ADD Procfile /app/Procfile 32 | 33 | ENV RAILS_ENV production 34 | 35 | CMD bundle exec rake assets:precompile && foreman start -f Procfile 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 ChangHoon, Jeong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dockerfile/java:oracle-java8 2 | MAINTAINER ChangHoon Jeong 3 | 4 | ENV ES_PKG_NAME elasticsearch-1.4.4 5 | 6 | # Install ElasticSearch. 7 | RUN \ 8 | cd / && \ 9 | wget https://download.elasticsearch.org/elasticsearch/elasticsearch/$ES_PKG_NAME.tar.gz && \ 10 | tar xvzf $ES_PKG_NAME.tar.gz && \ 11 | rm -f $ES_PKG_NAME.tar.gz && \ 12 | mv /$ES_PKG_NAME /elasticsearch 13 | 14 | # Define mountable directories. 15 | VOLUME ["/data"] 16 | 17 | # Define working directory. 18 | WORKDIR /data 19 | 20 | # Expose ports. 21 | # - 9200: HTTP 22 | # - 9300: transport 23 | EXPOSE 9200 24 | EXPOSE 9300 25 | 26 | ENV ES_HEAP_SIZE 1g 27 | 28 | ADD elasticsearch.yml /elasticsearch/config/elasticsearch.yml 29 | 30 | RUN ["/elasticsearch/bin/plugin", "--install", "lmenezes/elasticsearch-kopf/1.4.6"] 31 | RUN ["/elasticsearch/bin/plugin", "--install", "royrusso/elasticsearch-HQ"] 32 | RUN ["/elasticsearch/bin/plugin", "--install", "lukas-vlcek/bigdesk"] 33 | RUN ["/elasticsearch/bin/plugin", "--install", "mobz/elasticsearch-head"] 34 | RUN ["/elasticsearch/bin/plugin", "--install", "karmi/elasticsearch-paramedic"] 35 | 36 | ENTRYPOINT ["/elasticsearch/bin/elasticsearch"] -------------------------------------------------------------------------------- /fluentd-es/Dockerfile: -------------------------------------------------------------------------------- 1 | # from https://github.com/GoogleCloudPlatform/kubernetes/blob/master/contrib/logging/fluentd-es-image/Dockerfile 2 | FROM ubuntu:14.04 3 | MAINTAINER ChangHoon Jeong "iamseapy@gmail.com" 4 | 5 | # Ensure there are enough file descriptors for running Fluentd. 6 | RUN ulimit -n 65536 7 | 8 | # Install prerequisites. 9 | RUN apt-get update && \ 10 | apt-get install -y curl && \ 11 | apt-get install -y -q libcurl4-openssl-dev make && \ 12 | apt-get clean 13 | 14 | # Install Fluentd. 15 | RUN /usr/bin/curl -L http://toolbelt.treasuredata.com/sh/install-ubuntu-trusty-td-agent2.sh | sh 16 | 17 | # Change the default user and group to root. 18 | # Needed to allow access to /var/log/docker/... files. 19 | RUN sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent 20 | 21 | # Install Fluentd plug-in 22 | ## Elasticsearch 23 | RUN /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch 24 | ## add hostname 25 | RUN /usr/sbin/td-agent-gem install fluent-plugin-hostname 26 | 27 | # Copy the Fluentd configuration file. 28 | COPY td-agent.conf /etc/td-agent/td-agent.conf 29 | 30 | # Copy a script that determines the name of the host machine 31 | # and then patch the Fluentd configuration files and then 32 | # run Fluentd in the foreground. 33 | ADD run.sh /run.sh 34 | RUN chmod 700 /run.sh 35 | 36 | # Always run the this setup script. 37 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /rails-nginx-unicorn/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM seapy/ruby:2.2.0 2 | MAINTAINER ChangHoon Jeong 3 | 4 | RUN apt-get update 5 | 6 | # Install nodejs 7 | RUN apt-get install -qq -y nodejs 8 | 9 | # Intall software-properties-common for add-apt-repository 10 | RUN apt-get install -qq -y software-properties-common 11 | 12 | # Install Nginx. 13 | RUN add-apt-repository -y ppa:nginx/stable 14 | RUN apt-get update 15 | RUN apt-get install -qq -y nginx=1.8.0-1+trusty1 16 | RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf 17 | RUN chown -R www-data:www-data /var/lib/nginx 18 | # Add default nginx config 19 | ADD nginx-sites.conf /etc/nginx/sites-enabled/default 20 | 21 | # Install foreman 22 | RUN gem install foreman 23 | 24 | # Install the latest postgresql lib for pg gem 25 | RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ 26 | apt-get update && \ 27 | DEBIAN_FRONTEND=noninteractive \ 28 | apt-get install -y --force-yes libpq-dev 29 | 30 | ## Install MySQL(for mysql, mysql2 gem) 31 | RUN apt-get install -qq -y libmysqlclient-dev 32 | 33 | # Install Rails App 34 | WORKDIR /app 35 | ONBUILD ADD Gemfile /app/Gemfile 36 | ONBUILD ADD Gemfile.lock /app/Gemfile.lock 37 | ONBUILD RUN bundle install --without development test 38 | ONBUILD ADD . /app 39 | 40 | # Add default unicorn config 41 | ADD unicorn.rb /app/config/unicorn.rb 42 | 43 | # Add default foreman config 44 | ADD Procfile /app/Procfile 45 | 46 | ENV RAILS_ENV production 47 | 48 | CMD bundle exec rake assets:precompile && foreman start -f Procfile 49 | -------------------------------------------------------------------------------- /kibana/kibana.yml: -------------------------------------------------------------------------------- 1 | # Kibana is served by a back end server. This controls which port to use. 2 | port: ::KIBANA_PORT:: 3 | 4 | # The host to bind the server to. 5 | host: "::KIBANA_HOST::" 6 | 7 | # The Elasticsearch instance to use for all your queries. 8 | elasticsearch_url: "::ES_URL::" 9 | 10 | # preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, 11 | # then the host you use to connect to *this* Kibana instance will be sent. 12 | elasticsearch_preserve_host: true 13 | 14 | # Kibana uses an index in Elasticsearch to store saved searches, visualizations 15 | # and dashboards. It will create a new index if it doesn't already exist. 16 | kibana_index: "::KIBANA_INDEX::" 17 | 18 | # The default application to load. 19 | default_app_id: "::APP_ID::" 20 | 21 | # Time in milliseconds to wait for responses from the back end or elasticsearch. 22 | # This must be > 0 23 | request_timeout: ::REQUEST_TIMEOUT:: 24 | 25 | 26 | # Time in milliseconds for Elasticsearch to wait for responses from shards. 27 | # Set to 0 to disable. 28 | shard_timeout: ::SHARD_TIMEOUT:: 29 | 30 | # Set to false to have a complete disregard for the validity of the SSL 31 | # certificate. 32 | verify_ssl: ::VERIFY_SSL:: 33 | 34 | # Plugins that are included in the build, and no longer found in the plugins/ folder 35 | bundled_plugin_ids: 36 | - plugins/dashboard/index 37 | - plugins/discover/index 38 | - plugins/doc/index 39 | - plugins/kibana/index 40 | - plugins/markdown_vis/index 41 | - plugins/metric_vis/index 42 | - plugins/settings/index 43 | - plugins/table_vis/index 44 | - plugins/vis_types/index 45 | - plugins/visualize/index -------------------------------------------------------------------------------- /rails-nginx-unicorn/README.md: -------------------------------------------------------------------------------- 1 | # Rails(+ Nginx, Unicorn) Dockerfile 2 | 3 | Easy useable docker for rails. less configuration, affordable production. 4 | 5 | ## What's include 6 | 7 | * unicorn, nginx, foreman 8 | * mysql, postgresql lib 9 | 10 | # Usage 11 | 12 | * Create `Dockerfile` to your project and paste below code. 13 | 14 | ``` 15 | # Dockerfile 16 | FROM seapy/rails-nginx-unicorn 17 | MAINTAINER seapy(iamseapy@gmail.com) 18 | 19 | EXPOSE 80 20 | ``` 21 | 22 | * Add `unicorn` gem(maybe uncomment `gem 'unicorn'` in `Gemfile`) 23 | 24 | ## Build and run docker 25 | 26 | ``` 27 | # build your dockerfile 28 | $ docker build -t your/project . 29 | 30 | # run container 31 | $ docker run -d -p 80:80 -e SECRET_KEY_BASE=secretkey your/project 32 | ``` 33 | 34 | ## Screencast 35 | 36 | [Easy Ruby On Rails deploy on Docker](http://youtu.be/QgmzBuPuM6I) 37 | 38 | 39 | # Custom pre-install lib 40 | 41 | if your rails app required pre-install lib like imagemagick(or others) use [`rails-nginx-unicorn-pro`](https://github.com/seapy/dockerfiles/tree/master/rails-nginx-unicorn-pro) 42 | 43 | 44 | # Customize Nginx, Unicorn, foreman config 45 | 46 | ## Nginx 47 | 48 | ``` 49 | # your Dockerfile 50 | ... 51 | ADD config/your-custom-nginx.conf /etc/nginx/sites-enabled/default 52 | ... 53 | ``` 54 | 55 | ## Unicorn 56 | 57 | place your unicorn config to `config/unicorn.rb` 58 | 59 | ## foreman 60 | 61 | place your Procfile to app root 62 | 63 | 64 | # Use a specific version of Ruby, Nginx 65 | 66 | Change `FROM` instruction your Dockerfile 67 | 68 | ``` 69 | # Dockerfile 70 | FROM seapy/rails-nginx-unicorn:ruby2.2.0-nginx1.6.0 71 | ... 72 | ``` 73 | 74 | 75 | # TODO 76 | 77 | * github connection setting(like bitbucket) 78 | -------------------------------------------------------------------------------- /elasticsearch/README.md: -------------------------------------------------------------------------------- 1 | # What's differ `dockerfile/elasticsearch` 2 | 3 | * image tagging 4 | * java 8 5 | * use es commandline option 6 | * pre install useful plugin 7 | * HQ 8 | * bigdesk 9 | * kopf 10 | * head 11 | * paramedic 12 | 13 | 14 | # Usage 15 | 16 | ```shell 17 | # x.x.x.x server 18 | $ docker run -d -p 9200:9200 -p 9300:9300 \ 19 | -v /data/elasticsearch:/data/mnt \ 20 | seapy/elasticsearch:java8-es1.4.4 \ 21 | --node.name=$(hostname) \ 22 | --network.publish_host=$(hostname -i) \ 23 | --discovery.zen.ping.multicast.enabled=false \ 24 | --discovery.zen.ping.unicast.hosts=x.x.x.x:9300,y.y.y.y:9300 25 | ``` 26 | 27 | ```shell 28 | # y.y.y.y server 29 | $ docker run -d -p 9200:9200 -p 9300:9300 \ 30 | -v /data/elasticsearch:/data/mnt \ 31 | seapy/elasticsearch:java8-es1.4.4 \ 32 | --node.name=$(hostname) \ 33 | --network.publish_host=$(hostname -i) \ 34 | --discovery.zen.ping.multicast.enabled=false \ 35 | --discovery.zen.ping.unicast.hosts=x.x.x.x:9300,y.y.y.y:9300 36 | ``` 37 | 38 | ## options usage 39 | 40 | ```shell 41 | $ docker run -d -p 9200:9200 -p 9300:9300 \ 42 | -v /data/elasticsearch:/data/mnt \ 43 | -e ES_HEAP_SIZE=14g \ 44 | seapy/elasticsearch:java8-es1.4.4 \ 45 | --node.name=$(hostname) \ 46 | --cluster.name=ironman_elastic \ 47 | --network.publish_host=$(hostname -i) \ 48 | --discovery.zen.ping.multicast.enabled=false \ 49 | --discovery.zen.ping.unicast.hosts=x.x.x.x:9300,y.y.y.y:9300 50 | ``` 51 | 52 | # Override conf 53 | 54 | you can overrinde config option like `cluster.name: my_cluster` 55 | 56 | ```shell 57 | docker run -d ... seapy/elasticsearch --cluster.name: my_cluster 58 | ``` 59 | 60 | # How to build 61 | 62 | ```shell 63 | $ docker build -t seapy/elasticsearch:java8-es1.4.4 . 64 | ``` 65 | 66 | # Info 67 | 68 | `--network.publish_host` options is key point. when you missed this, unicast cluster can't work. 69 | 70 | [Running an ElasticSearch Cluster on CoreOS](http://mattupstate.com/coreos/devops/2014/06/26/running-an-elasticsearch-cluster-on-coreos.html) -------------------------------------------------------------------------------- /rails-nginx-unicorn-pro/README.md: -------------------------------------------------------------------------------- 1 | # Rails(+ Nginx, Unicorn) Dockerfile Pro 2 | 3 | Easy useable docker for rails. more configuration, affordable production. 4 | 5 | ## What's include 6 | 7 | * unicorn, nginx, foreman 8 | 9 | 10 | # Usage 11 | 12 | * Create `Dockerfile` to your project and paste below code. 13 | 14 | ``` 15 | # Dockerfile 16 | FROM seapy/rails-nginx-unicorn-pro:v1.1-ruby2.3.0-nginx1.8.1 17 | MAINTAINER seapy(iamseapy@gmail.com) 18 | 19 | # Add here your preinstall lib(e.g. imagemagick, mysql lib, pg lib, ssh config) 20 | 21 | #(required) Install Rails App 22 | ADD Gemfile /app/Gemfile 23 | ADD Gemfile.lock /app/Gemfile.lock 24 | RUN bundle install --without development test 25 | ADD . /app 26 | 27 | #(required) nginx port number 28 | EXPOSE 80 29 | ``` 30 | 31 | * Add `unicorn` gem(maybe uncomment `gem 'unicorn'` in `Gemfile`) 32 | 33 | ## Build and run docker 34 | 35 | ``` 36 | # build your dockerfile 37 | $ docker build -t your/project . 38 | 39 | # run container 40 | $ docker run -d -p 80:80 -e SECRET_KEY_BASE=secretkey your/project 41 | ``` 42 | 43 | ## Screencast 44 | 45 | [Easy Ruby On Rails deploy on Docker](http://youtu.be/QgmzBuPuM6I) 46 | 47 | 48 | # Custom pre-install lib 49 | 50 | if your rails app required lib like imagemagick(or mysql) you must install that before `Install Rails App` section 51 | 52 | ## Install imagemagick 53 | 54 | ``` 55 | RUN apt-get update 56 | RUN apt-get -qq -y install libmagickwand-dev imagemagick 57 | ``` 58 | 59 | ## Install MySQL(for mysql, mysql2 gem) 60 | 61 | ``` 62 | RUN apt-get update 63 | RUN apt-get install -qq -y mysql-server mysql-client libmysqlclient-dev 64 | ``` 65 | 66 | ## Install PostgreSQL lib(for pg gem) 67 | 68 | ``` 69 | RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ 70 | apt-get update && \ 71 | DEBIAN_FRONTEND=noninteractive \ 72 | apt-get install -y --force-yes libpq-dev 73 | ``` 74 | 75 | ## Access bitbucket private repository 76 | 77 | ``` 78 | RUN mkdir /root/.ssh/ 79 | ADD id_rsa /root/.ssh/id_rsa 80 | RUN touch /root/.ssh/known_hosts 81 | RUN ssh-keyscan -t rsa bitbucket.org >> /root/.ssh/known_hosts 82 | ``` 83 | 84 | Copy your `~/.ssh/id_rsa` to `id_rsa` for bitbucket connection. if you don't need to bitbucket connection, create blank `id_rsa`. don't forget add `id_rsa` to `.gitignore` 85 | 86 | # Log check using docker logs 87 | 88 | Add below line to `config/environments/production.rb` 89 | 90 | `config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))` 91 | 92 | # Customize Nginx, Unicorn, foreman config 93 | 94 | ## Nginx 95 | 96 | ``` 97 | # your Dockerfile 98 | ... 99 | ADD config/your-custom-nginx.conf /etc/nginx/sites-enabled/default 100 | ... 101 | ``` 102 | 103 | ## Unicorn 104 | 105 | place your unicorn config to `config/unicorn.rb` 106 | 107 | ## foreman 108 | 109 | place your Procfile to app root 110 | --------------------------------------------------------------------------------