Skip to content

Instantly share code, notes, and snippets.

Vincent Schoener vschoener

Block or report user

Report or block vschoener

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vschoener
vschoener / Dockerfile
Last active Jun 18, 2019
Multi Stage docker file example with NODE
View Dockerfile
# --- Installing stage
FROM node:11.4 AS installer
WORKDIR /usr/src/app
ARG NODE_ENV=production
ARG NPM_TOKEN=
ENV NODE_ENV=${NODE_ENV}
COPY package*.json ./
View nodemon.json
{
"watch": ["src"],
"ext": "ts",
"exec": "ts-node ./src/boot.ts"
}
@vschoener
vschoener / docker-compose.yml
Created Jan 5, 2019 — forked from seanhandley/docker-compose.yml
How To Set Up Docker For Mac with Native NFS
View docker-compose.yml
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
View Makefile
all: clean down build
build:
docker-compose build
build-nc:
docker-compose build --no-cache
start:
docker-compose up
View docker-compose.yml
version: "3.8"
services:
app:
container_name: dockertsdev_app
command: npm run start:dev
build: .
volumes:
- .:/app
# Don't forget this part, it's really important
View boot.ts
import express from 'express';
import http from 'http2';
const app = express();
app.get('/', () => { message: 'Hellow Docker and TypeScript' });
http.createServer(app).listen('8080', () => {
console.log('Ready fox! I\'m listening')
View Dockerfile
FROM node:11.4 as base
WORKDIR /app
# use changes to package.json to force Docker not to use the cache
# when we change our application's nodejs dependencies:
COPY package*.json /tmp/
RUN cd /tmp && npm install --quiet
RUN cp -r /tmp/node_modules /app
@vschoener
vschoener / tsconfig.json
Last active Dec 30, 2018
Docker & TypeScript development
View tsconfig.json
{
// This attribute will hold all the compile option of TypeScript
"compilerOptions": {
// Where are located your source code
"rootDir": "src",
// Where you want to put our compiled code
"outDir": "build",
// Which ES library you want to include
View index.tsx
import * as React from 'react';
import { render as ReactRender } from 'react-dom';
import { Provider } from 'react-redux';
import { Router, Route } from 'react-router-dom';
import './scss/main.scss';
import SignIn from './components/auth/signin/SignIn';
import SignUp from './components/auth/signup/SignUp';
import Event from './components/dashboard/event/Event';
import AuthorizedRoute from './hoc/AuthorizedRouteHOC';
View reducer.ts
import authReducer, { AuthStateInterface } from '../components/auth/authReducer';
// Interface inside my reducer file
// export interface AuthStateInterface {
// authenticated?: string | null;
// }
export interface IAppState {
//... Other state you need here
auth: AuthStateInterface;
}
You can’t perform that action at this time.