Giter Club home page Giter Club logo

nodeprinter's Introduction

① server/index.ts 打开这个文件 设置端口号 // 这里需要设置端口号 const PORT = 6000;

这里也需要跟Dockerfile 文件中的端口号,保持一致

②  执行 docker-compose up -d

② ③ ④

From Node:12-alpine3.12 FROM node:18-buster-slim Debian FROM node:18-buster ubuntu

启动docker容器

コンテナ起動

docker-compose up -d --build

进入docker容器

コンテナ内に入る

docker-compose exec node-dev sh docker-compose exec node-dev bash

启动docker容器

コンテナ内で必要パッケージを追加

npm init -y npm install typescript ts-node ts-node-dev

$ npm install -D typescript ts-node @types/node $ npm install -D @types/express

生成tsconfig.json文件

tsconfig.jsonファイルを作成

npx tsc --init

yarnの初期化(必要に応じて入力する)

$ yarn init

加入package各种依赖包, 初始化typescript

パケージの導入

$ yarn add express $ yarn add --dev @types/express @types/node typescript ts-node-dev

コンテナ内

TypeScriptの初期化

$ yarn run tsc --init

Makefile

up: docker-compose up -d

up-prod: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

down: docker-compose down

nodeprinter's People

Contributors

kenny67 avatar

Watchers

 avatar

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.