Hi, i setup a node project (project name :- dtest, path: c:/dtest) and run it with docker (command docker build and docker run)… it is working fine…
Now i set up another project and try to run it with docker composer (name: dctest , path c:/dctest)…
project structure is listed below
dctest
– apps
– .env
– docker.compose.yml
.env
COMPOSE_CONVERT_WINDOWS_PATHS=1
MYSQL_PORT = 3306
DTEST_PORT = 15000
DTEST = C:\dtest
docker-compose.yml
version: '2.1'
services:
mysql:
image: mysql
container_name: test-mysql
restart: always
ports:
- '${MYSQL_PORT:-3306}:3306'
dtest:
image: node:8.5-alpine
container_name: dtest
environment:
- NODE_PORT=15000
restart: always
ports:
- '${DTEST_PORT:-15000}:15000'
working_dir: /apps/dtest
volumes:
- "${DTEST:-./apps/dtest}:/apps/dtest"
command: ["npm", "start"]
When i tried to run it with command “docker-composer up -d” i got the error that can not mount vloume. i Tried with multiple path format but it display path related issue… like
-
ERROR: for dtest Cannot start service dtest: oci runtime error: container_linux.go:265: starting
container process caused “exec: “apps/dtest/entrypoint.sh”:
stat apps/dtest/entrypoint.sh: no such file or directory” -
ERROR: for dtest Cannot start service dtest: oci runtime error: container_linux.go:265: starting
container process caused “exec: “apps/dtest/package.json”:
stat apps/dtest/package.json: no such file or directory” -
I change the command : [“ls”, “-lah”], and again run the up command result is listed below
drwxr-xr-x 6 root root 140 Dec 26 11:11 .
drwxr-xr-x 3 root root 4.0K Dec 27 05:33 …
drwxr-xr-x 2 root root 40 Dec 26 11:11 entrypoint.sh
-rw-r–r-- 1 root root 27 Dec 23 20:56 package-lock.json
drwxr-xr-x 2 root root 40 Dec 25 13:00 package.json
drwxr-xr-x 3 root root 60 Dec 26 11:11 scripts
But my dtest folder contains some other files and folder like (node_modules, dist, images…) and also it display entrypoint.sh and package.json as directory not a file.
Versions
Docker version 17.10.0-ce, build f4ffd25
docker-machine.exe version 0.13.0, build 9ba6da9
docker-compose version 1.16.1, build 6d1ac219
docker-py version: 2.5.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016
Please tell me how i can run the project using docker-compose. thanks in advance.