This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function setup-swarm { | |
# first we go to our docker folder | |
cd _docker_setup | |
echo '···························' | |
echo '·· setting up the swarm >>>> ··' | |
echo '···························' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval `docker-machine env manager1` | |
array=('./movies-service' | |
'./cinema-catalog-service' | |
'./booking-service' | |
'./payment-service' | |
'./notification-service' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval `docker-machine env manager1` | |
array=('./movies-service' | |
'./cinema-catalog-service' | |
'./booking-service' | |
'./payment-service' | |
'./notification-service' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval `docker-machine env manager1` | |
array=('./movies-service' | |
'./cinema-catalog-service' | |
'./booking-service' | |
'./payment-service' | |
'./notification-service' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the first thing we specify in a Dockerfile is the base image. | |
# This is essentially bare bones alpine linux with node installed. | |
FROM node:7.5.0-alpine | |
# Creates a non-root-user. | |
RUN addgroup -S nupp && adduser -S -g nupp nupp | |
# Sets the HOME environment variable. | |
ENV HOME=/home/nupp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# default parameters | |
DRIVER="virtualbox" | |
MANAGERS=1 | |
WORKERS=2 | |
DISK_SIZE="20000" | |
MEMORY="2048" | |
DOCKER_VERSION="https://github.com/boot2docker/boot2docker/releases/download/v1.13.0/boot2docker.iso" | |
ADDITIONAL_PARAMS= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env mocha */ | |
const supertest = require('supertest') | |
// we need this to accept self-signed-certificates in nodejs | |
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0' | |
process.env.NODE_TLS_ACCEPT_UNTRUSTED_CERTIFICATES_THIS_IS_INSECURE = '1' | |
describe('cinema-catalog-service', () => { | |
const api = supertest('https://localhost:8080') | |
it('returns a 200 for a known movies through api-gateway', (done) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval `docker-machine env manager1` | |
array=('./movies-service' | |
'./cinema-catalog-service' | |
'./booking-service' | |
'./payment-service' | |
'./notification-service' | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const express = require('express') | |
const proxy = require('http-proxy-middleware') | |
const spdy = require('spdy') | |
const morgan = require('morgan') | |
const helmet = require('helmet') | |
const cors = require('cors') | |
const status = require('http-status') | |
const start = (container) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Docker = require('dockerode') | |
const discoverRoutes = (container) => { | |
return new Promise((resolve, reject) => { | |
// here we retrieve our dockerSettings | |
const dockerSettings = container.resolve('dockerSettings') | |
// we instatiate our docker object, that will communicate with our docker-machine | |
const docker = new Docker(dockerSettings) |