This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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 ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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 ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # 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 ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "watch": ["src"], | |
| "ext": "ts", | |
| "exec": "ts-node ./src/boot.ts" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| api: | |
| volumes: | |
| - "nfsmount:${CONTAINER_DIR}" | |
| volumes: | |
| nfsmount: | |
| driver: local | |
| driver_opts: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| all: clean down build | |
| build: | |
| docker-compose build | |
| build-nc: | |
| docker-compose build --no-cache | |
| start: | |
| docker-compose up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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') |