title: How can I fix the Error of Docker-compose up exited with code 1
body: <p>I am beginner in Docker.
  I have a simple DockerFile and Docker-compose.yml files
  When I use docker-compose up, then it show an error which is exited with code 1
  I do not know how can I fix it.
  my DockerFile:</p>
  
  <pre><code>FROM openjdk:8
  ENV APP_HOME /home
  RUN mkdir -p $APP_HOME
  ADD target/spring-docker.jar $APP_HOME/spring-docker.jar
  WORKDIR $APP_HOME
  EXPOSE 8080
  CMD ["java","-Dspring.data.mongodb.uri=mongodb://db:27017/","-jar","/home/spring-docker.jar"]
  </code></pre>
  
  <p>Docker-Compose:</p>
  
  <pre><code>version: '3.1'
  services:
      spring-docker:
          build: .
          restart: always
          ports: 
              - "8080:8080"
          depends_on:
             - db
      db:
          image: mongo
          volumes:
              - ./data:/data/db
          ports:
              - "27017:27017"
          restart: always
  </code></pre>
  
  <p>The SpringBoot is based application along with it’s mongodb database.</p>