Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 3.11 KB

README.md

File metadata and controls

69 lines (52 loc) · 3.11 KB

Basic Node.js App with Express

Deployed into an azure container using Azure WebApp package with Gihub Actions

This repo was created to clear how to deploy a single docker container runing a basic Node.js application with Typescript using azure/webapps-deploy@v2

Related with these issues #34451, #62946, #31771, 46401

Another common situations why your app is not running:

  1. don't use EXPOSE flag on Dockerfile (apparently Azure use it internally)

  2. SET WEBSITES_CONTAINER_START_TIME_LIMIT, increase it to max timeout

  3. USE PERSONAL ACCESS TOKEN INSTEAD GITHUB_TOKEN cause github tokens expires.

Following this steps you will be able to deploy your app with a Single dockerfile

Test live example deployed with this code

⚠️ If you try to test the app you need to wait a couple of minutes 'cause this deploy turn off the server on inactivity, just wait for a minute after hit a request and you will got a response.

This works if you came from GithubLab, GitHub Actions: Continuous Delivery with Azure 'cause the starter example with static files didn't work for me,you can make work it with this configuration too.

Project structure created with npx

npx create-express-typescript-application express-ts-app

Project structure:

                                                                    ─╯
.
├── build
│   ├── src
│   │   ├── app
│   │   │   ├── sample
│   │   │   └── server-status
│   │   ├── constants
│   │   │   └── endpoint.js
│   │   ├── utils
│   │   │   └── getFilesWithKeyword.js
│   │   ├── index.js
│   │   └── server.js
│   └── config.json
├── src
│   ├── app
│   │   ├── sample
│   │   │   └── sample.router.ts
│   │   └── server-status
│   │       ├── server-status.router.ts
│   │       └── server.status.service.ts
│   ├── constants
│   │   └── endpoint.ts
│   ├── utils
│   │   └── getFilesWithKeyword.ts
│   ├── index.ts
│   └── server.ts
├── Dockerfile
├── README.md
├── config.json
├── package-lock.json
├── package.json
└── tsconfig.json