FROM node:latest # Create app directory WORKDIR /usr/src/app # Install app dependencies COPY package*.json ./ RUN npm install # Build and test COPY tsconfig.json ./ COPY ./src ./src RUN npm run build --if-present RUN npm run test --if-present # Remove source files RUN rm -r ./src EXPOSE 3000 CMD [ "npm", "start" ]