elgris/microservice-app-example

Error: Service 'todos-api' failed to build: lstat routes: no such file or directory

ginhton opened this issue · 3 comments

I run docker-compose under Ubuntu 17.10, and meet

ERROR: Version in "./docker-compose.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

Then I change config file first line to version:"2", and rerun. I get following error:

Building todos-api
Step 1/7 : FROM node:8-alpine
 ---> 4db2697ce114
Step 2/7 : EXPOSE 8082
 ---> Using cache
 ---> 1349a10cc8e7
Step 3/7 : WORKDIR /usr/src/app
 ---> Using cache
 ---> abb433aceb6e
Step 4/7 : COPY package-lock.json package.json *.js /usr/src/app/
 ---> Using cache
 ---> afb48a69741e
Step 5/7 : COPY routes /usr/src/app/routes
ERROR: Service 'todos-api' failed to build: lstat routes: no such file or directory

I have no idea about what should I do next.

Getting the same problem
-- Lubuntu 16.04

add .js to routes, this line:

Step 5/7 : COPY routes.js /usr/src/app/routes

@orasik Thank you very much.
So the complete method is

cd todos-api
vim Dockerfile
change line "COPY routes /usr/src/app/routes" to "COPY routes.js /usr/src/app/routes". Then save and exit.
cd ..
docker-compose up