# Base Docker Compose file for OIPA
#
#

version: "3"
services:

  db:
    #FIXME: this is using latest (not particular) Postgres version:
    image: kartoza/postgis
    environment:
      POSTGRES_DB: oipa
      POSTGRES_USER: oipa
      POSTGRES_PASSWORD: oipa

  oipa:
    build: .
    #this starts 'db' service:
    depends_on:
      - db
    #see: https://docs.docker.com/compose/startup-order/
    command: ["/app/src/docker-entrypoint.sh", "python3.6", "/app/src/OIPA/manage.py", "runserver", "0.0.0.0:8000"]
    ports:
      - "8000:8000"
    environment:
      DJANGO_SETTINGS_MODULE: OIPA.docker_settings
      POSTGRES_DB: oipa
      # XXX: this has to match database service name, because this is passed to
      # the docker-entrypoint script:
      POSTGRES_HOST: db
      POSTGRES_USER: oipa
      POSTGRES_PASSWORD: oipa


  #oipa-supervisor:
    #build: .

# Base Docker Compose file for OIPA
#
#

version: "3"
services:

  db:
    #See https://hub.docker.com/r/kartoza/postgis for version info
    image: kartoza/postgis:9.6-2.4
    environment:
      POSTGRES_DB: oipa
      POSTGRES_USER: oipa
      POSTGRES_PASSWORD: oipa

  oipa:
    build: .
    #this starts 'db' service:
    depends_on:
      - db
    #see: https://docs.docker.com/compose/startup-order/
    command: ["/app/src/docker-entrypoint.sh", "python3.6", "/app/src/OIPA/manage.py", "runserver", "0.0.0.0:8000"]
    ports:
      - "8000:8000"
    environment:
      DJANGO_SETTINGS_MODULE: OIPA.docker_settings
      POSTGRES_DB: oipa
      # XXX: this has to match database service name, because this is passed to
      # the docker-entrypoint script:
      POSTGRES_HOST: db
      POSTGRES_USER: oipa
      POSTGRES_PASSWORD: oipa


  #oipa-supervisor:
    #build: .

Use a particular version of PostGIS image
Use a particular version of PostGIS image
