Giter Club home page Giter Club logo

docker's Introduction

Docker infrastructure scripts

My scripts to quickly bring up common docker infrastructure. All compose files don't bind any custom config files so it is usable on remote docker instances without copying any files. This is intended for smaller scale deployments on few machines using docker-compose. For larger scale infrastructure you should use Kubernetes anyway.

Frontend

Consists of nginx-dockergen-letsencrypt stack to proxy http requests to multiple containers. Advanced version is a bit more complex, but is more secure and monitoring friendly.

Usage:

docker-compose up -d on any host, then run any container on the same network with appropriate env variables:

version: '2'
services:
  app:
    image: app
    environment:
      VIRTUAL_HOST: example.com
      LETSENCRYPT_HOST: example.com
networks:
  default:
    external:
      name: frontend_default

Frontend will automatically generate nginx conf and a valid https certificate (if the domain has a valid DNS record) and will route all requests for specified host to this container. After https certificate is generated http endpoint will contain a redirect to https.

For more info see nginx proxy docs

Elastic

This will run ELK stack to storing data for monitoring

  • consider running it in dedicated server apart from main services.
cd elastic
cp .env.example .env

# Set credentials:
vi .env

# Set your `VIRTUAL_HOST` in docker-compose.yml 
vi docker-compose.yml

# Run  docker:
docker-compose up -d

Monitoring agent

Configured filebeat and metricbeat agents for ELK stack for log and metric ingestion. Collects all container logs, syslog, and auth log, and various container and host metrics. Indexes for advanced nginx stack above are already configured.

To run the agent configure .env variables:

cd monitoring
cp .env.example .env
# set ELASTICSEARCH_HOST same as VIRTUAL_HOST in Elastic (see above)
vi .env

#Run docker:
docker-compose up -d

Note that for monitoring we build the containers so if you change yaml configs in filebeat and metricbeat dir don't forget --build flag when updating containers.

  • go to Kibana at the host, that you specify in KIBANA_HOST, enter login and password (from .env file)
  • Enjoy!

Notifier

It will notify you in Telegram about changes status of running services

cd notifier
cp .env.example .env
vi .env

docker's People

Contributors

poma avatar skywinder avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.