Hi, I’m new to rescript.
Now I’m using rescript and webpack on windows. Everything works fine.
But when I try to dockerize the project I got some trouble.
Here is my dockerfile.
FROM node:18
WORKDIR /my-app
COPY package*.json ./
RUN npm install
COPY . .
And here is my docker-compose.yml.
version: '3'
services:
compiler:
container_name: compiler
build:
context: .
dockerfile: dev.dockerfile
command: npx rescript build -w
volumes:
- ./src:/my-app/src
tty: true
bundler:
container_name: bundler
build:
context: .
dockerfile: dev.dockerfile
command: bash -c 'npx rescript && npx webpack serve'
volumes:
- ./src:/my-app/src
ports:
- 4000:4000
Here is the situation.
- If I don’t use
tty: true
, I will quickly getcompiler exited with code 0
after>>>> Start compiling
. - If I use
tty: true
, it seems that build watcher can be kept in the container. But it doesn’t compile new file. I have checked the file in the container and it does changed.
Here are my questions.
- Is it correct to use
tty: true
? - Why new file change was not picked up in the container?