title: Docker-compose setup mongodb with data and a nodejs server
body: <p>i want to spin up a whole nodejs/mongodb environment with docker compose.i created a mongodump into radcupDevSample.json which i want to mongo restore i a new mongodb container. After this i want a new node container with my api linked to the mondodb container with the sample data. </p>
  
  <p>i have the following files:</p>
  
  <p><strong>1. docker-compose.yml:</strong></p>
  
  <pre><code>db:
    image: mongo
    ports: 
      - "27017:27017"`
  
  mongo-importer:
        build: .
  
  web: 
       build: web
       links:
              - db 
       ports:
              - "3000:3000"
        volumes: 
               - ./src:/home/env
        environment:
              NODE_ENV: development
  </code></pre>
  
  <p><strong>2. web Dockerfile:</strong></p>
  
  <pre><code>FROM node
  RUN apt-get update -y
  RUN apt-get install -y git
  RUN apt-get install -y vim
  RUN git clone https://sdsds-oauth-basic@github.com/jdklfj /home/app
  WORKDIR /home/app/src
  RUN npm install
  CMD "npm start"
  EXPOSE 3000
  </code></pre>
  
  <p><strong>3. "." dockerfile</strong></p>
  
  <pre><code>FROM mongo
  COPY radcupDevSample.json /radcupDevSample.json
  CMD mongorestore -h db /radcupDevSample.json
  </code></pre>
  
  <p>I used this answer mentioned here: 
  <a href="https://stackoverflow.com/questions/31210973/how-do-i-seed-a-mongo-database-using-docker-compose">How do I seed a mongo database using docker-compose?</a></p>
  
  <p>My problem is: if i try <code>docker-compose up</code> i get this error: </p>
  
  <pre><code>docker-compose up
  radcupbackend_db_1 is up-to-date
  Building web
  Traceback (most recent call last):
    File "&lt;string&gt;", line 3, in &lt;module&gt;
    File "/compose/compose/cli/main.py", line 54, in main
    File "/compose/compose/cli/docopt_command.py", line 23, in sys_dispatch
    File "/compose/compose/cli/docopt_command.py", line 26, in dispatch
    File "/compose/compose/cli/main.py", line 171, in perform_command
    File "/compose/compose/cli/main.py", line 587, in up
    File "/compose/compose/project.py", line 313, in up
    File "/compose/compose/service.py", line 404, in execute_convergence_plan
    File "/compose/compose/service.py", line 303, in create_container
    File "/compose/compose/service.py", line 326, in ensure_image_exists
    File "/compose/compose/service.py", line 723, in build
    File "/compose/venv/lib/python2.7/site-packages/docker/api/build.py", line 41, in build
  TypeError: You must specify a directory to build in path
  docker-compose returned -1
  </code></pre>
  
  <p><strong><em>Have someone a "hint" why i get this errors ? Or maybe could someone help me out to set up this environment ?</em></strong> </p>
  
  <p>Thank you! </p>
  
  <p>PS. building the 2 Dockerfiles separately don't throw any error... </p>