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
version: "3.8" | |
services: | |
api: | |
entrypoint: sh -c "npm run start-debug" | |
ports: | |
- "9229:9229" | |
expose: | |
- ${API_PORT} |
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
# Node.js Production Dockerfile | |
FROM node:14-alpine | |
# Update the system | |
RUN apk --no-cache -U upgrade | |
# Alpine comes with a non-root user called 'node' with a home directory at /home/node | |
# Prepare destination directory and ensure user node owns it |
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
function aim() { vim ./COMMIT_MSG; } | |
function fire() { vim ./COMMIT_MSG && ( git commit -F ./COMMIT_MSG $* ) && rm ./COMMIT_MSG; } |
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
/* jshint esversion : 6 */ | |
/* Author : Alan Hortz <[email protected]> */ | |
const express = require('express'); | |
const app = express(); | |
const server = require('http').createServer(app); | |
const io = require('socket.io')(server); | |
const metawear = require('node-metawear'); | |
var rate = 50; |
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
FROM node:latest | |
RUN mkdir /app | |
ADD ./src /app | |
ADD ./package.json / | |
RUN npm install | |
# CMD can be overriden by | |
# - docker run [COMMAND] |
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
var mdns = require('mdns'); | |
var ad = mdns.createAdvertisement(mdns.tcp('http'),3000, {name: 'Node Server'}); | |
ad.start(); |