Skip to content

A simple dockerised typescript koa server, ready to be developed and deployed

Notifications You must be signed in to change notification settings

hanchiang/typescript-node-docker

Repository files navigation

Introduction

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

Setup

Install required tools

Clone project

  • git clone git@github.com:hanchiang/typescript-node-docker.git

Set up environment variables

.env.dev:

  • COOKIE_SECRET=mycookiesecret
  • NODE_ENV=development

Using the project

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

Note

Whenever new packages are added via npm install:

  • You need to stop the service: docker-compose stop <service> or docker-compose down
  • Build the service: docker-compose build <service>
  • Start the service: docker-compose start <service> or docker-compose up -d

Reference

About

A simple dockerised typescript koa server, ready to be developed and deployed

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published