Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
CADBOT committed Feb 18, 2016
0 parents commit 1c31bf9
Show file tree
Hide file tree
Showing 3,912 changed files with 765,644 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
100 changes: 100 additions & 0 deletions 2-2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// inside directory
// microservice-externaldb/
// officalNodeDockerfile
// node-microservice/
// two-microservices/

// terminal commands
// vi officialNodeDockerfile
/*
FROM buildpack-deps:jessie

#verify gpg and sha256: http://nodejs.org/dist/v0.10.30/SHASUMS256.txt.asc
#gpg: aka "Timothy J Fontaine (Work) <tj.fontaine@joyent.com>"
#gpg: aka "Julien Gilli <jgilli@fastmail.fm>"
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys 7937DFD2AB06298B229

EVN NODE_VERSION 0.10.40
ENV NPM_VERSION 2.11.3

RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-l"
&& curl -SLO "https://nodesjs.ord/dist/v$NODE_VERSION/SHASUM256.txt.asc"
&& gpg --verify SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-x64.tar.gz\$" SHASUMS256.txt.asc |
&& tar -xzf "node-v$NODE_VERSION-linux-x64.tar.gz" -C /usr/local --stri
&& rm "node-v$NODE_VERSION-linux-x64.tar.gz" SHASUMS256.txt.asc \
&& npm install -g npm@"$NPM_VERSION" \
&& npm cache clear

CMD [ "node" ]
*/

// next terminal command
// docker run -it node
// docker pull node
// docker run -it node "drops into node terminal"
// console.log('hello');

// terminal commands
//cd node-microservice/
//inside node-microservice/
//Dockerfile
//node_modules/
//package.json
//server.js

//terminal
//vi server.js

/* inside server.js
var express = require('express');
var app = express();

app.get('/', function(req, res) {
res.json({'msg': 'helloworld'})
});

var port = process.env.port || 3000;
app.listen(port, function() {
console.log('server started');
});
*/

//terminal
// node server.js &
// curl http://localhost:3000
// vi Dockerfile

/* inside DockerFile
FROM node:0.12.7

RUN mkdir -p /user/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app
RUN npm install

EXPOSE 3000

CMD [ "npm", "start" ]
*/

//terminal
//npm install
//rm -r node_modules/
//docker build -t myservice .
//docker run my-service
//docker run -P -d myservice
//docker ps
//curl http://localhost:37269
//git init
//git add Dockerfile package.json server.js
//git commit -m 'initial commit dockerized app'








11 changes: 11 additions & 0 deletions 2-2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:0.12.7

RUN mkdir -p /user/src/app
WORKDIR /usr/src/app

COPY . /usr/src/app
RUN npm install

EXPOSE 3000

CMD [ "npm", "start" ]
Loading

0 comments on commit 1c31bf9

Please sign in to comment.