Coder Social home page Coder Social logo

docker-samples's Introduction

Docker Samples

Collection of docker-compose, swarm and kubernetes samples for different scenarios. The motivation of this project is to keep tracking of new releases and to document real-world scenarios for a production environment. Feel free to contribute with more scenarios.

Overview

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To install follow the instructions and pre-requirements.

Basic compose commands

running

cd [folder]
docker-compose up -d

monitoring

docker-compose logs -f

stop

docker-compose stop

clean up

docker-compose down
#clean databases and volumes
docker-compose down -v

Basic Swarm commands

running

cd [folder]
docker stack deploy -c docker-stack.yml <service-name>

monitoring

docker service logs -f <service-name>

clean up

docker stack rm <service-name>
#clean databases and volumes
docker volume prune

Basic Kubernetes Commands

running in declarative mode

cd [folder]
kubectl apply -f k8s-specs/

monitoring

kubectl logs deploy/<servicename> -n namespace --follow

clean up

kubectl delete -f k8s-specs

Key features

The examples include option to create database user for the application avoiding using root user as in most of the samples. Also, create scripts that allow use secrets even for custom database users.

docker-samples's People

Contributors

eliezerreis 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.