Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
New Year's resolution coming :)

Vincent Schoener vschoener

💭
New Year's resolution coming :)
  • Paris
View GitHub Profile
View Dockerfile
#
# 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 ./
View snaps.e2e.ts
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 Apr 29, 2020
Dockerfile stage production
View Dockerfile
#
# 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
View Dockerfile
#
# 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 Apr 29, 2020
Multi Stage docker file example with NODE
View Dockerfile
#
# 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 ./
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')
You can’t perform that action at this time.