Skip to content

Instantly share code, notes, and snippets.

View dylanlott's full-sized avatar
🏗️
Hacking

d7t dylanlott

🏗️
Hacking
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dylanlott on github.
  • I am dylanlott (https://keybase.io/dylanlott) on keybase.
  • I have a public key whose fingerprint is 0A13 481E 4F65 B5DD AC28 EE1C E1A7 A5AC A012 2E76

To claim this, I am signing this object:

@dylanlott
dylanlott / docker-compose.yml
Created October 26, 2016 22:55
docker-compose.yml example for the Docker First Deploy Fast blog series
version: "2"
services:
web:
build: . //build the web container from our current directory Dockerfile
ports:
- '8080:8080' //bind external ports to container ports
working_dir: '/app'
command: npm run start //the command to run to start the container
environment:
- MONGO_URI=mongodb://mongo:27017 //pass mongo conection string params to container
@dylanlott
dylanlott / Dockerfile
Created October 30, 2016 17:29
Serve front end using NGINX and Docker
FROM kyma/docker-nginx
COPY dist/ /var/www/
CMD 'nginx'
@dylanlott
dylanlott / node-dockerfile
Last active October 30, 2016 19:26
node-dockerfile
FROM node:argon
RUN mkdir -p /usr/src/app
COPY package.json /usr/src/app
RUN npm install
COPY ./ /usr/src/app
EXPOSE 8080
CMD [“npm”, “run”, “start”]
@dylanlott
dylanlott / hello-world.js
Last active October 30, 2016 19:38
Hello World example app for Docker
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(8080, function () {
console.log('Example app listening on port 8080!');
});
@dylanlott
dylanlott / package.json
Created October 30, 2016 19:40
package.json example for Docker tutorials
{
"name": "myapp",
"version": "1.0.0",
"description": "Docker tutorial my-app",
"main": "hello-world.js",
"scripts": {
"start": "node hello-world.js"
},
"author": "Your Name Here",
"license": "ISC",
version: "2"
services:
mongo:
image: mongo
ports:
- '27017:27017'
server:
build: my-app-repo/my-server
ports:
- '8080:8080'
@dylanlott
dylanlott / docker-compose-node-mongo.yml
Created December 15, 2016 22:06
docker-compose.yml file for a node/mongo starter pack
version: '2'
services:
mongodb:
image: bitnami/mongodb:latest
ports:
- '27017:27017'
web:
image: node:latest
volumes:
- ./src/app:/usr/src/app
@dylanlott
dylanlott / api_utils.js
Last active January 13, 2017 15:58
CRUD API utility written in 36 lines of code, using native Promises and Mongoose methods.
module.exports.create = function (model, body) {
return Promise((resolve, reject) => {
new model(body).save()
.then((result) => resolve(result))
.catch((err) => reject(err))
})
}
module.exports.query = function (model, query) {
return Promise((resolve, reject) => {
model.find(query)
// ***** Customer View ********************************************************************/
<div class="row header">
<img src="/assets/img/logo-light.png" alt="fashionphilelogo" class='logosmall col-xs-4' />
<br>
<h6 id='locationName'>
<span class='locationName'> {{customerLocation.name}} </span>
</h6>
</div>