Skip to content

Instantly share code, notes, and snippets.

@vickyRathee
Created December 3, 2021 05:12
Show Gist options
  • Save vickyRathee/a57ee2c6194596fd8837e7d32620ac1e to your computer and use it in GitHub Desktop.
Save vickyRathee/a57ee2c6194596fd8837e7d32620ac1e to your computer and use it in GitHub Desktop.
Deploying NestJS application on Elastic Beanstalk via Code pipeline
# Do not change version. This is the version of aws buildspec, not the version of your buldspec file.
version: 0.2
phases:
install:
runtime-versions:
nodejs: '12'
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install
build:
commands:
- echo Build started on `date`
- echo Running build...
- npm run build
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- "**/*"
@vickyRathee
Copy link
Author

Package.json should have start command as "start": "node dist/main

{
  "name": "nest-test",
  "version": "0.0.1",
  "description": "nest.js testing",
  "author": "Vikash Rathee",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "node dist/main",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment