version: '2.1'
services:
  onlyoffice-documentserver:
    container_name: onlyoffice-documentserver
    build:
      context: ../../.
      dockerfile: Dockerfile
    depends_on:
      - onlyoffice-oracle
    environment:
      - DB_TYPE=${DB_TYPE:-oracle}
      - DB_HOST=${DB_HOST:-onlyoffice-oracle}
      - DB_PORT=${DB_PORT:-1521}
      - DB_NAME=${DB_NAME:-xepdb1}
      - DB_USER=${DB_USER:-onlyoffice}
      - DB_PWD=${DB_PWD:-onlyoffice}
    stdin_open: true
    restart: always
    ports:
      - '80:80'

  onlyoffice-oracle:
    container_name: onlyoffice-oracle
    build:
      context: .
      dockerfile: oracle.Dockerfile
      args:
        - ORACLE_DATABASE=${DB_NAME:-xepdb1}
        - ORACLE_USER=${DB_USER:-onlyoffice}
        - ORACLE_PASSWORD=${DB_PWD:-onlyoffice}
    restart: always
    volumes:
      - oracle_data:/opt/oracle/oradata
    expose:
      - '1521'

volumes:
  oracle_data:
