title: setting up postgis on Gitlab CI
body: <p>I've being trying to setup gitlab CI with my django project. The project uses postgis extension. After all this setup I still get the error that postgis.control file could not be found</p>
  
  <pre><code>$ export PGPASSWORD=$POSTGRES_PASSWORD
  $ psql -c "CREATE EXTENSION IF NOT EXISTS postgis;" -d $POSTGRES_DB -U $POSTGRES_USER -h "postgres"
  ERROR:  could not open extension control file "/usr/share/postgresql/11/extension/postgis.control": No such file or directory
  ERROR: Job failed: exit code 1
  </code></pre>
  
  <p>Here is my .gitlab-ci.yml file</p>
  
  <pre><code>image: python:3.6
  
  stages:
    - test
  
  services:
    - mdillon/postgis
    - postgres
  
  variables:
    POSTGRES_DB: my_db
    POSTGRES_USER: my_user
    POSTGRES_PASSWORD: ""
    TESTFOLDER: "myapp/apps/api myapp/apps/logger"
    DATABASE_URL: "postgres://my_user:@mdillon-postgis/my_db"
  
  test:
    stage: test
    image: mdillon/postgis
    before_script:
      - apt-get update -qy
      - export PGPASSWORD=$POSTGRES_PASSWORD
      - psql -c "CREATE EXTENSION IF NOT EXISTS postgis;" -d $POSTGRES_DB -U    $POSTGRES_USER -h "postgres"
      - psql -c "CREATE EXTENSION IF NOT EXISTS postgis_topology;" -d $POSTGRES_DB -U $POSTGRES_USER -h "postgres"
      - apt-get install -y openjdk-8-jre-headless libjpeg-dev zlib1g-dev software-properties-common ghostscript libxslt1-dev binutils libproj-dev libgdal-dev gdal-bin memcached libmemcached-dev 
      - export DEBIAN_FRONTEND=noninteractive;
      - pip install --upgrade pip
      - pip install -r requirements/base.pip
      - pip install flake8
    script:
      - python manage.py test $TESTFOLDER --noinput --settings=myapp.settings.gitlab_ci --parallel 4 --verbosity=2
    only:
      - master
  </code></pre>