Code Monkey home page Code Monkey logo

satrapu / iquest-keyboards-and-mice-brasov-2018 Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 46 KB

Resources for "How to Control Service Startup Order in Docker Compose" presentation @ iQuest K&M, Brașov, 2018.

Home Page: https://www.iquestgroup.com/news/event/keyboards-mice-brasov-2018

License: Apache License 2.0

C# 38.22% Shell 38.47% Dockerfile 23.31%
docker-compose docker-engine-api jq unix-socket curl docker docker-image postgresql dotnet-core2-1 docker-multi-stage-build

iquest-keyboards-and-mice-brasov-2018's Introduction

iQuest Keyboards & Mice - Brașov - 2018

Table of Contents

This repo contains the resources used during "How to Control Service Startup Order in Docker Compose" presentation at the Keyboards & Mice iQuest public event, which took place in Brașov on June 6th, 2018.

This presentation is based on this article, but while the latter shows a Java console application fetching data from a MySQL database, the former uses a .NET Core console application fetching data from a PostgreSQL database.

SlideShare: https://www.slideshare.net/satrapu/how-to-control-service-startup-order-in-docker-compose

  • Clone this repo
git clone https://github.com/satrapu/iquest-keyboards-and-mice-brasov-2018.git
cd ./iquest-keyboards-and-mice-brasov-2018
  • Start services

    • Using depends_on, condition and service_healthy:
    # Windows - PowerShell console run as admin
    cd .\compose\service-healthy `
    ;cmd /c mklink /J .\sources .\..\..\sources `
    ;docker-compose down --rmi local `
    ;docker-compose build `
    ;docker-compose up app
    # Linux - Bash
    cd ./compose/service-healthy \
    && mkdir ./sources && cp ../../sources/* sources \
    && docker-compose down --rmi local \
    && docker-compose build \
    && docker-compose up app
    • Using Docker Engine API
    # Windows - PowerShell console run as admin
    cd .\compose\docker-engine-api `
    ;cmd /c mklink /J .\sources .\..\..\sources `
    ;$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1 `
    ;docker-compose down --rmi local `
    ;docker-compose build `
    ;docker-compose up app
    # Linux - Bash
    cd ./compose/docker-engine-api \
    && mkdir ./sources && cp ../../sources/* sources \
    && docker-compose down --rmi local \
    && docker-compose build \
    && docker-compose up app
    • Using port checking++
    # Windows - PowerShell console run as admin
    cd .\compose\port-checking++ `
    ;cmd /c mklink /J .\sources .\..\..\sources `
    ;docker-compose down --rmi local `
    ;docker-compose build `
    ;docker-compose up --exit-code-from check_db_connectivity check_db_connectivity `
    ;if ($LASTEXITCODE -eq 0) { docker-compose up app } `
    else { echo "ERROR: Failed to start service due to one of its dependencies!" }
    # Linux - Bash
    cd ./compose/port-checking++ \
    && mkdir ./sources && cp ../../sources/* sources \
    && docker-compose down --rmi local \
    && docker-compose build \
    && docker-compose up --exit-code-from check_db_connectivity check_db_connectivity \
    && if [ $? -eq 0 ]; then docker-compose up app; else echo 'ERROR: Failed to start service due to one of its dependencies!'; fi

iquest-keyboards-and-mice-brasov-2018's People

Contributors

satrapu avatar

Stargazers

 avatar

Watchers

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