---
version: "3"
services:
  geocontrib-front:
    image: neogeo/geocontrib-front
    build: .
    ports:
      - 8080:80
    volumes:
      - geocontrib_media:/opt/geocontrib/media
      - geocontrib_static:/opt/geocontrib/static

  geocontrib:
    image: neogeo/geocontrib
    environment:
      - "SECRET_KEY=CHANGEME"
      - DEBUG=True
      - TIME_ZONE=Europe/Paris
      - LOG_LEVEL=INFO
      - "ALLOWED_HOSTS=*"
      - "THIRD_PARTY_DJANGO_APPS=rest_framework, rest_framework_gis"
      - "OUR_APPS=geocontrib, api"
      - TIME_SLEEP=5
      - BASE_URL=localhost:8080
      - DB_USER=geocontrib
      - DB_PWD=geocontrib
      - DB_NAME=geocontrib
      - DB_HOST=geocontrib-db
      - DB_PORT=5432
      - APP_ADMIN_USER=admin
      - APP_ADMIN_PWD=admin
      - APP_ADMIN_EMAIL=admin@acme.com
      - DEFAULT_SENDING_FREQUENCY=instantly
      - APPLICATION_NAME=GéoContrib
      - APPLICATION_ABSTRACT=Site de développement pour GéoContrib (dev-tim)
      #- LOGIN_URL=/cas/login

    volumes:
      - geocontrib_media:/home/apprunner/geocontrib_app/media
      - geocontrib_static:/home/apprunner/geocontrib_app/static

  geocontrib-db:
    restart: always
    image: postgis/postgis:11-2.5-alpine
    environment:
      - POSTGRES_USER=geocontrib
      - POSTGRES_PASSWORD=geocontrib
      - POSTGRES_DB=geocontrib

    volumes:
      - geocontrib_db:/var/lib/postgresql/data/

volumes:
  geocontrib_db:
  geocontrib_static:
  geocontrib_media:
