title: How to install java using docker compose?
body: <p>I am building an node mongo project.
  I am using docker compose for the project.
  here is my dockerFile</p>
  
  <pre><code>FROM node:carbon
  WORKDIR /usr/src/app
  COPY package*.json ./
  RUN npm install
  COPY . .
  EXPOSE 8080
  CMD [ "npm", "start" ]
  </code></pre>
  
  <p>Here is docker-compose.yml</p>
  
  <pre><code>version: "2"
  services:
    app:
      container_name: app
      restart: always
      build: .
      ports:
        - "3000:3000"
      links:
        - mongo
    mongo:
      container_name: mongo
      image: mongo
      volumes:
        - ./data:/data/db
      ports:
        - "27017:27017"
  </code></pre>
  
  <p>Here I also want to install java using docker-compose. As I will need java for elastic search and for other purposes. So can any one help about how to install java using docker-compose in this project.</p>