Giter Site home page Giter Site logo

kevinpollet / typescript-docker-multi-stage-build Goto Github PK

View Code? Open in Web Editor NEW
35.0 3.0 4.0 1.1 MB

๐Ÿณ This repository shows how to build a Docker image for a Node.js + TypeScript app with the Docker multi-stage feature

License: MIT License

TypeScript 75.74% Dockerfile 24.26%
docker multi-stage-build typescript nodejs multi-stage example

typescript-docker-multi-stage-build's Introduction

typescript-docker-multi-stage-build

Build Status License

The purpose of this repository is to show how you can build a Docker image for a Node.js + TypeScript app with the Docker multi-stage feature, available since version 17.05.

Run the app

  1. Install dependencies: npm install
  2. Start the app: npm start
  3. Call the greeting endpoint:
curl http://localhost:3000/greeting\?name\=John

{"id":"76ac792c-c1a9-4fc5-ba75-39652a06b381","message":"Hello, John!"}

Build the Docker image

To build the Docker image, use the docker build command:

docker build . -t greeting-service:latest

To stop the build on a specific stage, use the target option:

docker build --target builder -t greeting-service:latest .

Run the Docker image

To run the Docker image, use the docker run command:

docker run -p 3000:3000 --rm greeting-service:latest

Then, you can invoke the greeting service running in a Docker container with:

curl http://localhost:3000/greeting\?name\=Docker

{"id":"7af0385b-99dc-4d47-a423-f6ab18ea7f1c","message":"Hello, Docker!"}

Contributing

Contributions are welcome!

Submit an issue or a pull request if you want to contribute some code.

License

MIT

typescript-docker-multi-stage-build's People

Contributors

dependabot-preview[bot] avatar kevinpollet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

typescript-docker-multi-stage-build's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.