This is a typescript koa project with the following features:
- docker with multi stage build for development and production
- docker compose for development
- error handlers
- tests with mocha and sinon
- prettier
- eslint
git clone git@github.com:hanchiang/typescript-node-docker.git
.env.dev:
COOKIE_SECRET=mycookiesecretNODE_ENV=development
Run in development mode
- Build:
docker-compose build - Start:
docker-compose up -d - Server is available at:
localhost:3000 - Stop:
docker-compose down
Build production image
npm run docker-build-prod
Whenever new packages are added via npm install:
- You need to stop the service:
docker-compose stop <service>ordocker-compose down - Build the service:
docker-compose build <service> - Start the service:
docker-compose start <service>ordocker-compose up -d