Skip to content

Instantly share code, notes, and snippets.

View pintux's full-sized avatar

Antonio Pintus pintux

View GitHub Profile
@pintux
pintux / server.js
Last active February 12, 2016 00:48
Simple node.js (v5.6.x) server to inspect HTTP requests.
'use strict'
const http = require('http');
console.log(`Server listening at port ${process.env.PORT || 8080}`);
http.createServer((request, response) => {
let headers = request.headers;
let method = request.method;
@pintux
pintux / Dockerfile.nginx
Created October 13, 2015 13:57
Dockerfile to build a NGINX image including a simple configuration file for NGINX server
FROM nginx
MAINTAINER Antonio Pintus
RUN mkdir /etc/nginx/logs/
RUN touch /etc/nginx/logs/error.log
# copy and use the customized conf file
COPY nginx.conf /etc/nginx/nginx.conf
@pintux
pintux / nginx.conf
Created October 13, 2015 13:48
A simple NGINX configuration file to act at reverse-proxy / load balancer for 2 dockerized application nodes
worker_processes 2;
events {
worker_connections 4096;
use epoll;
}
http {
upstream nodes {
least_conn;
server node1:3000;
@pintux
pintux / Dockerfile
Last active October 12, 2015 15:05
Simple Dockerfile to dockerize a local node.js / Express app
FROM node:4.1.2-onbuild
# docker mantainer
MAINTAINER pintux
# install all needed packages
RUN npm install
# expose port
EXPOSE 3000