Connecting to File Shares

Default Monolith deployments store files on the local file system of the host that is running Monolith's Docker containers.

If you want to use an external file share, you will need to adjust the docker-compose.yml file to include configuration settings for the file share you would like to use.

Windows/CIFS Share

To connect to a basic Windows file share, add the following configuration to the bottom of your docker-compose.yml file:

volumes:
  monolith:
    driver: local
    driver_opts:
      type: cifs
      o: "username=your_username,password=your_password,domain=your_domain"
      device: "//<SHARE_IP_ADDRESS>/share/data"
  • Replace your_username, your_password, your_domain with the appropriate credentials for accessing the CIFS share. your_domain is not required if your share does not have a specific domain, so you can omit this value.

  • Replace //<SHARE_IP_ADDRESS>/share with the network path to your CIFS share, but append the "/data" location at the end.

To utilize this new volume, we need adjust the current volumes listed in each service block of the docker-compose.yml file.

// Some code
monolith-api:
  container_name: monolith-api
  image: monolithforensics/monolith-api:latest
  restart: always
  volumes:
    - monolith:/usr/src/app/data
  ports:
    - "3001:3001"
  env_file:
    - .env
  mem_limit: 512m

Final docker-compose.yml File with CIFS

The following demonstrates the final docker-compose.yml file once a CIFS share has been configured:

docker-compose.yml
services:
  monolith-api:
    container_name: monolith-api
    image: monolithforensics/monolith-api:latest
    restart: always
    volumes:
      - monolith:/usr/src/app/data
    ports:
      - "3001:3001"
    env_file:
      - .env
    mem_limit: 512m

  monolith-forms:
    container_name: monolith-forms
    image: monolithforensics/monolith-forms:on-prem
    restart: always
    volumes:
       - monolith:/usr/src/app/data
    ports:
      - "3003:3003"
    mem_limit: 150m

  monolith:
    container_name: monolith
    image: monolithforensics/monolith:on-prem
    restart: always
    volumes:
      - monolith:/usr/src/app/data
    ports:
      - "3005:3005"
    mem_limit: 150m

  mysql:
    container_name: mysql2
    image: mysql:8.0.16
    command: --default-authentication-plugin=mysql_native_password --sql_mode=""
    security_opt:
      - seccomp:unconfined
    restart: always
    ports:
     - "3307:3306"
    environment:
      MYSQL_ROOT_PASSWORD: ${MONOLITH_DB_PASSWORD}
      MYSQL_USER: ${MONOLITH_DB_USER}
      MYSQL_PASSWORD: ${MONOLITH_DB_PASSWORD}
      MYSQL_DATABASE: ${MONOLITH_DB_NAME}
    volumes:
      - ./data/mysql:/var/lib/mysql
      - ./init:/docker-entrypoint-initdb.d
    mem_limit: 512m

  nginx:
    container_name: nginx
    image: monolithforensics/nginx:latest
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
     - monolith:/usr/src/app/data

  watchtower:
    container_name: watchtower
    image: containrrr/watchtower:latest
    restart: always
    environment:
      - WATCHTOWER_CLEANUP=true
    command: --interval 30
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    mem_limit: 512m

# Connect CIFS share
volumes:
  monolith:
    driver_opts:
      type: cifs
      o: username={username},password={password},vers=3.0
      device: //192.168.1.12/Monolith/data

Last updated