title: How to install phantomjs and selenium with docker-compose on linux server?
body: <p>I am using selenium and phantomjs for my web scraper.
  All works great with my test windows app.
  Trying to add this code update to my main app, deployed with docker-compose, and i get this:
  <code>selenium.common.exceptions.WebDriverException: Message: 'phantomjs' executable needs to be in PATH.</code></p>
  <p>How should i fix this?
  currently my docker-compose.yml has this code:</p>
  <pre><code>version: '3.1'
  
  services:
  
    tgbot:
      container_name: bot
      build:
        context: .
      command: python app.py
      restart: always
      environment:
        WEBAPP_PORT: 3001
      env_file:
        - &quot;.env&quot;
      # bot start after load db
      ports:
        - 8443:3001
      networks:
        - botnet
  
    phantomjs:
      image: shufo/phantomjs
      command: --webdriver 8901
  
  networks:
        botnet:
          driver: bridge
  </code></pre>
  <p>And my python code:</p>
  <pre><code>from selenium import webdriver
  driver = webdriver.PhantomJS()
  </code></pre>
  <p>Dockefile:</p>
  <pre><code>FROM python:latest
  
  RUN mkdir /src
  WORKDIR /src
  COPY requirements.txt /src
  RUN pip install -r requirements.txt
  COPY . /src
  </code></pre>
  <p>P.S. i am using phantomjs because webpage i am scraping has JS. doesnt work with chrome</p>