typescriptdockerdocker-composedockerfilenestjs

The system cannot find the file specified typescript


I'm trying to run build containers in docker but im getting an error The system cannot find the file specified

Docker version 27.3.1, build ce12230
Docker Desktop 4.35.1 (173168)
Windows 11 Pro version 23H2

the error is happening when I run

docker compose -f docker-compose.dev.yml up --build

You can see folder structure in the image, I want to mention something that I'm finding it strange when I run the command why it ends with you-app-backend ?

resolve : CreateFile C:\Users\user\Desktop\YOUAPP_FULLSTACK_PROJECT\you-app-backend\notification-microservice\you-app-backend:

Shouldn't be notification-microservice only? In addition, why every time when I run the command the path is changing to another microservice?

docker error

if you want to see the docker compose file or docker files here is my project link

[https://github.com/Moemen12/YOUAPP_FULLSTACK_PROJECT/][github_link]


Solution

  • Your issue is related to the dockerfile paths provided for the microservice containers. You're already passing in a context and dockerfile is relative to context as mentioned in the docs.

    Replace each dockerfile in the docker-compose.dev.yml file to Dockerfile.dev, for example:

      chat-service:
        build:
          context: ./you-app-backend/chat-microservice
          dockerfile: Dockerfile.dev
        container_name: chat-microservice