Skip to content

Instantly share code, notes, and snippets.

View vschoener's full-sized avatar
💭
New Year's resolution coming :)

Vincent Schoener vschoener

💭
New Year's resolution coming :)
View GitHub Profile
#
# Builder stage.
# This state compile our TypeScript to get the JavaScript code
#
FROM node:12.16.3 AS builder
WORKDIR /usr/src/app
COPY package*.json ./
COPY tsconfig*.json ./
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as nock from 'nock';
import { Collection } from 'mongodb';
import * as request from 'supertest';
import { AppModule } from '../../src/app.module';
import { getModelToken } from 'src/core/mongodb/mongodb.utils';
import { Snap } from 'src/snaps/model/schema/snaps.schema';
import { DateManager } from 'src/core/utils/date-manager.service';
@vschoener
vschoener / Dockerfile
Last active April 29, 2020 14:48
Dockerfile stage production
#
# Production stage.
# This state compile get back the JavaScript code from builder stage
# It will also install the production package only
#
FROM node:12.13.0-alpine
WORKDIR /app
ENV NODE_ENV=production
@vschoener
vschoener / Dockerfile
Created November 8, 2019 12:32
build stage
#
# Builder stage.
# This state compile our TypeScript to get the JavaScript code
#
FROM node:12.13.0 AS builder
WORKDIR /usr/src/app
COPY package*.json ./
COPY tsconfig*.json ./
@vschoener
vschoener / Dockerfile
Last active April 29, 2020 14:48
Multi Stage docker file example with NODE
#
# Builder stage.
# This state compile our TypeScript to get the JavaScript code
#
FROM node:12.13.0 AS builder
WORKDIR /usr/src/app
COPY package*.json ./
COPY tsconfig*.json ./
{
"watch": ["src"],
"ext": "ts",
"exec": "ts-node ./src/boot.ts"
}
@vschoener
vschoener / docker-compose.yml
Created January 5, 2019 00:42 — forked from seanhandley/docker-compose.yml
How To Set Up Docker For Mac with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
all: clean down build
build:
docker-compose build
build-nc:
docker-compose build --no-cache
start:
docker-compose up
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
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')