Skip to content

Instantly share code, notes, and snippets.

version: '3'
services:
my-project-ts:
build: .
depends_on:
- mongodb
ports:
- '3000:3000'
environment:
- NODE_ENV=production
FROM node:dubnium-alpine
WORKDIR /app
COPY . .
RUN npm install --no-progress --quiet
RUN npm run build
CMD [ "npm", "start", "--silent" ]
"start": "node ./dist/index.js"
// at the top
import * as config from "config";
// during the db plugin registration
server.register(db, config.get('db'));
db:
uri: "mongodb://mongodb:27017/vehicles"
db:
uri: "mongodb://localhost:27017/vehicles"
npm i config
"exclude": ["node_modules", "./src/**/__tests__/*.ts"]
{
"type": "node",
"request": "launch",
"name": "Debug jest test",
"preLaunchTask": "npm run build",
"program": "${workspaceRoot}/node_modules/.bin/jest",
"args": [
"--config",
"${workspaceRoot}/jest.config.js",
"--runInBand",
{
"version": "2.0.0",
"tasks": [
{
"label": "npm run build",
"type": "npm",
"script": "build",
"problemMatcher": []
}
]