version: "3"
services:
  ldap:
    image: dcm4che/slapd-dcm4chee:2.6.3-30.0
    logging:
      driver: json-file
      options:
        max-size: "10m"
    ports:
      - "395:389"
    environment:
      STORAGE_DIR: /storage/fs1
    volumes:
      - ./dcm4chee-arc/ldap:/var/lib/openldap/openldap-data
      - ./dcm4chee-arc/slapd.d:/etc/openldap/slapd.d
    restart: always
  db:
    image: dcm4che/postgres-dcm4chee:15.2-30 # imagem contem dezenas de create, update e alter tables
    logging:                                 # que criam o ambiente para funcionamento do dcm
      driver: json-file
      options:
        max-size: "10m"
    ports:
      - "5439:5432"
    environment:
      POSTGRES_DB: pacsdb_g2i_sonora
      POSTGRES_USER: pacsdb_g2i_sonora
      POSTGRES_PASSWORD: q84k40vzMlsGY9VL6
    volumes:
      - ./etc/localtime:/etc/localtime:ro
      - ./etc/timezone:/etc/timezone:ro
      - ./dcm4chee-arc/db:/var/lib/postgresql/data #volume que armazena os dados do banco
    restart: always
  arc:
    image: dcm4che/dcm4chee-arc-psql:5.30.0
    logging:
      driver: json-file
      options:
        max-size: "10m"
    ports:
      - "8894:8080"
      - "8450:8443"
      - "9976:9990"
      - "9999:9993"
      - "11118:11112"
      - "2768:2762"
      - "2581:2575"
      - "12581:12575"
    environment:
      POSTGRES_DB: pacsdb_g2i_sonora
      POSTGRES_USER: pacsdb_g2i_sonora
      POSTGRES_PASSWORD: q84k40vzMlsGY9VL6
      WILDFLY_CHOWN: /storage
      WILDFLY_ADMIN_USER: 'admin'
      WILDFLY_ADMIN_PASSWORD: '051390'
      WILDFLY_WAIT_FOR: ldap:389 db:5432 # ele realiza a conexão diretamente no container pgsql na mesma network.
      KEYSTORE: /opt/wildfly/standalone/configuration/keystores/keystore.pkcs12 #comentar essa linha caso não utilizar certificado ssl
      KEYSTORE_PASSWORD: '051390' #comentar essa linha caso não utilizar certificado ssl
    depends_on:
      - ldap
      - db
    volumes:
      - ./etc/localtime:/etc/localtime:ro
      - ./etc/timezone:/etc/timezone:ro
      - ./dcm4chee-arc/wildfly:/opt/wildfly/standalone # armazena dados de config do wildfly
      - ./dcm4chee-arc/storage:/storage # armazena os dados recebidos do dicom la na fs1/ano/mes/dia/arquivo
      - ./path/keystore.pkcs12:/opt/wildfly/standalone/configuration/keystores/keystore.pkcs12 # comentar essa linha caso não utilizar certificado ssl
    restart: always
  ohif-viewer-container:
    image: ohif/app:v3.7.0-beta.62
    ports:
      - '3010:4443'
    environment:
      SSL_PORT: 4443
      #PORT: 8081
      APP_CONFIG: "/usr/share/nginx/html/app-config.js"
    volumes:
      - ./path/server.crt:/etc/ssl/certs/ssl-certificate.crt:ro #comentar essa linha caso não utilizar certificado ssl
      - ./path/server.key:/etc/ssl/private/ssl-private-key.key:ro #comentar essa linha caso não utilizar certificado ssl
      - ./config.js:/usr/share/nginx/html/default.js:ro
      - ./ohif.js:/usr/share/nginx/html/app-config.js:ro
    restart: always