Skip to content

Instantly share code, notes, and snippets.

@alaboudi
alaboudi / compose.js
Created January 24, 2018 22:05
Function to compose other functions
const compose = (...fns) =>
fns.reverse().reduce((prevFn, nextFn) =>
value => nextFn(prevFn(value)),
value => value
);
@alaboudi
alaboudi / Dockerfile
Created October 14, 2017 03:51
Docker file for Angular4 application on an Nginx server
# This docker file will consist of two stages. The first stage will be used to arrange the application
# dependencies and compile it. The second stage will be used to set up an nginx server to serve the
# static angular content.
### Stage 1: Downloading application dependencies and compiling angular AoT
# Create image based on the official Node based on the Alpine linus distribution image from dockerhub
FROM node:alpine AS builder
# Create a directory where our app will be placed. -p is to create parent directories as necessary