Skip to content

nodejs total.js.flow

Dockerfile

Dockerfile
FROM node:18.17.1

RUN npm install npm@latest -g
RUN npm install total.js -g
RUN npm install total4 -g

Makefile

Makefile
WORK_DIR  := /root/project
CACHE_DIR := /root/.cache
IMAGE_TAG := node18

DOCKER_RUN := docker run \
--rm -it \
-v $(PWD):$(WORK_DIR) \
-v $(PWD)/cache:$(CACHE_DIR) \
-w $(WORK_DIR)/flow \
--network host \
$(IMAGE_TAG)

build:
	docker build . -t $(IMAGE_TAG)
install:
	$(DOCKER_RUN) npm install
run:
	$(DOCKER_RUN) npm run $(name)

docker-compose.yml

yml
version: '3'
services:
  flow:
    build: 
      context: .
      dockerfile: Dockerfile
    image: node18
    restart: always
    volumes:
      - ./:/root/project
      - ./cache:/root/.cache
    working_dir: /root/project/flow
    command: total.js 8000
    network_mode: host

Released under the MIT License.