1

I have a React project that includes TypeScript and I want to make sure all the TypeScript is converted to JavaScript. Specifically, in my route, I have a server.ts file that I compile by typing tsc server.ts. All the other files seem to work automatically (maybe it's WebStorm doing that for me, not sure).

I tried to update my dockerfile to compile server.ts but it's not working. when I do my docker build, I see the latest TypeScript version echoing but it always says after that server.ts not found.

Please suggest how to update my dockerfile below.

FROM node:alpine

# Create app directory
RUN mkdir -p /usr/src
WORKDIR /usr/src

# Install app dependencies
COPY package.json /usr/src/
COPY package-lock.json /usr/src/
RUN npm install
RUN npm install --global ntypescript typescript


# Bundle app source
COPY . /usr/src

RUN tsc -v
RUN tsc server.ts

RUN npm run build

EXPOSE 3000

CMD ["npm", "start"]

1 Answer 1

0

use node:10-alpine i have same issue and resolve it by updating it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.