Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot mount a volume when running docker-compose from dev environment #133

Open
sbland opened this issue Sep 1, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@sbland
Copy link

sbland commented Sep 1, 2022

Describe the bug
Running a developer envionment with a docker-compose file in root. When running the compose file the volumes are not mounted.

To Reproduce
Steps to reproduce the behavior:

  1. Run docker-compose up or sudo docker-compose run --entrypoint /bin/bash -v $PWD/app/client:/app client
  2. It spins up the container but no volumes are attached

Expected behavior
/app should contain the contents of /app/client from the dev environment

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise
  • Version 21H2

Version of Docker Desktop:
You can find the version by clicking on the About Docker Desktop menu

4.11.1

Additional context
Compose file:

services:
  client:
    image: client
    ports:
      - 3000:3000
    build:
      context: ./app/client
    volumes:
      - ./app/client:/app
      - ./app/client/node_modules:/app/node_modules

client dockerfile:

FROM node:16

# set working directory
WORKDIR /app

ENV PATH /app/node_modules/.bin:$PATH

EXPOSE 3000
# start app
CMD ["yarn", "start"]
@sbland sbland added the bug Something isn't working label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant