0

My docker-compose file is simple:

npm:
    image: node
    volumes:
        - C:\Users\Samir\npm\:/home/dev
    container_name: npm

When I run it:

docker-compose up -d

I get:

Starting npm

Then, nothing happens:

docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Any idea?

1 Answer 1

1

Per default the Node image is designed for interactive use and simply starts a Node REPL. When you run docker-compose up -d the Node REPL will start and exit immediately as no interactive terminal is availabe. Try:

docker-compose run -it npm

Note that this is currently not supported on Windows, you will need to use docker run -it -v ... node instead.

If you want to start your application instead simply override the default command in your docker-compose.yml

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.