EOX GitLab Instance

Skip to content
Snippets Groups Projects
docker-compose.yml 5.4 KiB
Newer Older
Nikola Jankovic's avatar
Nikola Jankovic committed
services:
  database:
    image: mdillon/postgis:10
    volumes:
      - db-data:/var/lib/postgresql/data
    env_file:
Nikola Jankovic's avatar
Nikola Jankovic committed
    environment:
      INSTANCE_ID: "prism-view-server_database"
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - intnet
    command: ["postgres", "-c", "max_connections=300"]
    sysctls:
      net.ipv4.tcp_keepalive_time: 600
      net.ipv4.tcp_keepalive_probes: 5
      net.ipv4.tcp_keepalive_intvl: 10
  redis:
    image: redis
    volumes:
      - redis-data:/data
    deploy:
      placement:
        constraints: [node.role == manager]
    networks:
      - intnet
  renderer:
    volumes:
      - type: tmpfs
        target: /tmp
      - type: volume
        source: instance-data
        target: /var/www/pvs
    env_file:
      - ./config/db.env
      - ./config/django.env
Lubomir Dolezal's avatar
Lubomir Dolezal committed
    secrets:
Nikola Jankovic's avatar
Nikola Jankovic committed
      - DJANGO_PASSWORD
      - DJANGO_SECRET_KEY
    environment:
      INSTANCE_ID: "prism-view-server_renderer"
      INSTALL_DIR: "/var/www/pvs/dev/"
      INIT_SCRIPTS: "/opt/core/configure.sh /opt/core/init-db.sh /opt/core/initialized.sh"
      STARTUP_SCRIPTS: "/opt/core/wait-initialized.sh"
Nikola Jankovic's avatar
Nikola Jankovic committed
      WAIT_SERVICES: "database:5432"
      WAIT_TIMEOUT: 180
      DJANGO_PASSWORD_FILE: "/run/secrets/DJANGO_PASSWORD"
      DJANGO_SECRET_KEY_FILE: "/run/secrets/DJANGO_SECRET_KEY"
      GDAL_DISABLE_READDIR_ON_OPEN: "TRUE"
      CPL_VSIL_CURL_ALLOWED_EXTENSIONS: ".TIF,.tif,.xml"
{%- if slug in ["dem", "demF"] %}
Lubomir Dolezal's avatar
Lubomir Dolezal committed
      ENABLE_HTTP_ACCESS: "true"
{%- endif %}
Nikola Jankovic's avatar
Nikola Jankovic committed
    configs:
      - source: init-db
        target: /opt/core/init-db.sh
Nikola Jankovic's avatar
Nikola Jankovic committed
    deploy:
      replicas: 1
    networks:
      - intnet
  cache:
    volumes:
      - type: tmpfs
        target: /tmp
    env_file:
Nikola Jankovic's avatar
Nikola Jankovic committed
    secrets:
      - OS_PASSWORD
Lubomir Dolezal's avatar
Lubomir Dolezal committed
    configs:
      - source: mapcache-config
        target: /mapcache-template.xml
Nikola Jankovic's avatar
Nikola Jankovic committed
    environment:
      INSTANCE_ID: "prism-view-server_cache"
      RENDERER_HOST: renderer
      WAIT_SERVICES: "database:5432 renderer:80"
      WAIT_TIMEOUT: 300
      OS_PASSWORD_FILE: "/run/secrets/OS_PASSWORD"
    deploy:
      replicas: 1
    logging:
      options:
        tag: "docker.apache2"
    networks:
      - intnet
  ingestor:
    command:
      ["python3", "/opt/ingestor/filedaemon.py"]
Nikola Jankovic's avatar
Nikola Jankovic committed
    volumes:
      - type: volume
        source: from-fepd
        target: /mnt/data
      - type: volume
        source: ingestor-data
        target: /var/ingestor
Nikola Jankovic's avatar
Nikola Jankovic committed
    environment:
      INSTANCE_ID: "prism-view-server_ingestor"
      INGESTOR_SUCCESS_DIR: "/var/ingestor/success"
      INGESTOR_FAIL_DIR: "/var/ingestor/fail"
    deploy:
      replicas: 1
    networks:
      - intnet
  preprocessor:
Lubomir Dolezal's avatar
Lubomir Dolezal committed
    secrets:
Nikola Jankovic's avatar
Nikola Jankovic committed
      - OS_PASSWORD_DOWNLOAD
    environment:
      INSTANCE_ID: "prism-view-server_preprocessor"
      WAIT_SERVICES: "redis:6379"
      OS_PASSWORD_FILE: "/run/secrets/OS_PASSWORD_{{slug | upper}}"
Nikola Jankovic's avatar
Nikola Jankovic committed
      OS_PASSWORD_DOWNLOAD_FILE: "/run/secrets/OS_PASSWORD_DOWNLOAD"
      GDAL_DISABLE_READDIR_ON_OPEN: "TRUE"
Nikola Jankovic's avatar
Nikola Jankovic committed
    configs:
      - source: preprocessor-config
        target: /config.yaml
    networks:
      - intnet
  registrar:
    volumes:
      - type: tmpfs
        target: /tmp
      - type: volume
        source: instance-data
        target: /var/www/pvs
      - type: volume
        source: report-data
        target: /mnt/reports/
    env_file:
      - ./config/db.env
      - ./config/django.env
Lubomir Dolezal's avatar
Lubomir Dolezal committed
    secrets:
Nikola Jankovic's avatar
Nikola Jankovic committed
      - DJANGO_PASSWORD
Nikola Jankovic's avatar
Nikola Jankovic committed
      - DJANGO_SECRET_KEY
    environment:
      INSTANCE_ID: "prism-view-server_registrar"
      INSTALL_DIR: "/var/www/pvs/dev/"
      INIT_SCRIPTS: "/opt/core/configure.sh /opt/core/init-db.sh /opt/core/initialized.sh"
Lubomir Dolezal's avatar
Lubomir Dolezal committed
      STARTUP_SCRIPTS: "/opt/core/wait-initialized.sh"
Nikola Jankovic's avatar
Nikola Jankovic committed
      WAIT_SERVICES: "redis:6379 database:5432"
      WAIT_TIMEOUT: 180
      OS_PASSWORD_FILE: "/run/secrets/OS_PASSWORD_{{slug | upper}}"
Nikola Jankovic's avatar
Nikola Jankovic committed
      DJANGO_PASSWORD_FILE: "/run/secrets/DJANGO_PASSWORD"
      DJANGO_SECRET_KEY_FILE: "/run/secrets/DJANGO_SECRET_KEY"
      REPORTING_DIR: "/mnt/reports/"
      GDAL_DISABLE_READDIR_ON_OPEN: "EMPTY_DIR"
      CPL_VSIL_CURL_ALLOWED_EXTENSIONS: ".TIF,.tif,.xml"
Nikola Jankovic's avatar
Nikola Jankovic committed
    configs:
      - source: init-db
        target: /opt/core/init-db.sh
Nikola Jankovic's avatar
Nikola Jankovic committed
      - source: registrar-config
        target: /config.yaml
    deploy:
      replicas: 1
    networks:
      - intnet
    command:
      ["/opt/core/run-registrar.sh"]
Nikola Jankovic's avatar
Nikola Jankovic committed
  client:
    deploy:
      replicas: 1
  sftp:
    volumes:
      - type: volume
        source: report-data
        target: /home/eox/data/to/panda
      - type: volume
        source: from-fepd
        target: /home/eox/data/from/fepd
    configs:
      - source: sftp_users_{{slug}}
        target: /etc/sftp/users.conf
    ports:
      - "{{sftp}}:22"
    deploy:
      replicas: 1
configs:
  sftp_users_{{slug}}:
    external: true
  init-db:
    file: ./config/init-db.sh
  mapcache-config:
    file: ./config/mapcache.xml
  client-config:
    file: ./config/index.html
Nikola Jankovic's avatar
Nikola Jankovic committed
  preprocessor-config:
    file: ./config/preprocessor-config.yaml
Nikola Jankovic's avatar
Nikola Jankovic committed
  registrar-config:
    file: ./config/registrar-config.yaml
Nikola Jankovic's avatar
Nikola Jankovic committed
volumes:
  db-data:
  redis-data:
  instance-data:
  from-fepd:
  report-data:
Nikola Jankovic's avatar
Nikola Jankovic committed
networks:
  intnet:
secrets:
  OS_PASSWORD_{{slug | upper}}:
    external: true
Nikola Jankovic's avatar
Nikola Jankovic committed
  OS_PASSWORD:
    external: true
  OS_PASSWORD_DOWNLOAD:
    external: true
  DJANGO_PASSWORD:
    external: true
  DJANGO_SECRET_KEY:
    external: true