Coder Social home page Coder Social logo

sgnn7 / deploying_with_docker Goto Github PK

View Code? Open in Web Editor NEW
13.0 3.0 11.0 24 KB

Code samples from my Deployment with Docker book

Home Page: https://www.amazon.com/Deployment-Docker-continuous-integration-applications/dp/1786469006

HTML 5.40% JavaScript 28.31% Shell 13.88% Dockerfile 52.41%

deploying_with_docker's Introduction

Deployment with Docker

This repository contains all the code that is used in the book.

Troubleshooting

Most problems with the code are due to the speed of development for the dependencies of NodeJS and they are listed here with solutions.

TypeError: 'connect' only accepts a callback

mongodb package was released with a new version that breaks backwards compatibility. The exact fix is here and is already available on the master branch of this repository.

body-parser deprecated undefined extended

This is another issue with the mongodb package changes that occured after the book was printed. Fix for this issue is here and the fix has also already been applied to the master branch of this repository.

deploying_with_docker's People

Contributors

sgnn7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

deploying_with_docker's Issues

TypeError: `connect` only accepts a callback

I'm following along with the lab in chapter 3 and I get this error when testing the web application (page 68):

/root/Labs/docker-labs/application_server/node_modules/mongodb/lib/mongo_client.js:257
    throw new TypeError('`connect` only accepts a callback');
    ^

TypeError: `connect` only accepts a callback
    at MongoClient.connect (/root/Labs/docker-labs/application_server/node_modules/mongodb/lib/mongo_client.js:257:11)
    at loadWordsFromDatabase (/root/Labs/docker-labs/application_server/index.js:21:19)
    at Object.<anonymous> (/root/Labs/docker-labs/application_server/index.js:50:1)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

What would be the reason for this ?

DeprecationWarning: URL string parser is deprecated

Hi I'm following the exercise of Chapter 3 and I get the application server running, and am able to input words in the Words field. I also see the words that I input in the terminal where the application is running.

However, in the browser the words that I input do not show up. I get the output as can be seen in the attached file.
screenshot-2018-5-25 docker words

The Warning error output in the terminal is as follows:

(node:4070) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

Magic IP not so magic

This so-called magic IP which is referenced in chapter 3 almost derailed me from finishing your book. I run native Ubuntu 16.04 and docker seems to assigna unique IP to each container, and it doesn't begin with 172.17.0.n.

So not only could I not use 172.17.0.1 anywhere, in nearly every place where it was used in the chapter 3 examples, I had to replace it with another IP address unique for the database or application-server container. What the book should have contained is how to find out which IP address that each container is assigned using for example the command.

$ sudo iptables -t nat -L -n

body-parser deprecation warning

Using Ubuntu 16.04,
I'm at the npm start step. The js application won't start outputting to console,
body-parser deprecated undefined extended: provide extended option index.js:21:20 current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.

Is there some portion I haven't installed correctly? or is this a correction I should make in the js?

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.