This is a sample TypeScript application that can be run in a Docker container.
To run this application locally, follow these steps:
- Clone this repository to your local machine.
- Make sure you have Node.js and npm installed.
- Install the dependencies by running:
npm install
- Build the TypeScript code:
npm run build
- Start the application:
npm start
Now, the application should be running on http://localhost:8080
.
Alternatively, you can run the application inside a Docker container.
- Make sure you have Docker installed on your machine.
- Build the Docker image with the following command:
docker build -t typescript-docker-app .
- Run the Docker container:
docker run -p 8080:8080 typescript-docker-app
Now, the application should be accessible at http://localhost:8080
from your browser.
The project has the following directory structure:
typescript-docker-app
├── Dockerfile
├── package.json
├── package-lock.json
├── tsconfig.json
├── src
│ ├── index.ts
└── dist
├── index.js
Dockerfile
: Configuration file for creating a Docker image.package.json
andpackage-lock.json
: Dependencies and npm scripts.tsconfig.json
: TypeScript compiler configuration.src
: Directory containing TypeScript source files.dist
: Directory containing compiled JavaScript files.
Feel free to modify the application and customize it according to your needs.
This project is licensed under the MIT License. See the LICENSE file for details.