:video_: Install Specify 7 with Docker (macOS & Ubuntu)


Note: The basic elements of this tutorial are shared on all systems!

If you are using Ubuntu, you can follow the same instructions but replace host.docker.internal in the docker-compose.yml file with 172.17.0.1 . This IP acts as the bridge between the docker instance and your host system.

You can use the SpBackupRestore application to make the backup used in this tutorial as an alternative to using the MariaDB/MySQL CLI or a MariaDB/MySQL GUI application.

Downloads

Required:

  • Docker and Docker Engine

  • YML file editor (BBEdit, VIM, nano, etc.)

  • Backup of a Specify database
    (Use CLI, DBeaver, SpBackupRestore, or MySQL Workbench)

    If you do not yet have a copy of a Specify database, you can create one using the Specify Setup Wizard bundled with Specify 6. Once this is created, you can back up the database and follow the tutorial above.

Reccomended:

MariaDB Homebrew Location:

/opt/homebrew/opt/mariadb/bin/mariadb


Example docker-compose.yml file from the video:

version: '3.7'
services:

  mariadb:
    restart: unless-stopped
    image: mariadb
    command: --max_allowed_packet=1073741824
    volumes:
      - "database:/var/lib/mysql"
      - "./seed-database:/docker-entrypoint-initdb.d"
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=specify
      - MYSQL_USER=master
      - MYSQL_PASSWORD=master

  specify7:
    restart: unless-stopped
    image: specifyconsortium/specify7-service:v7
    init: true
    volumes:
      - "specify6:/opt/Specify:ro"
      - "static-files:/volumes/static-files"
    environment:
      - DATABASE_HOST=mariadb
      - DATABASE_PORT=3306
      - DATABASE_NAME=specify
      - MASTER_NAME=master
      - MASTER_PASSWORD=master
      - SECRET_KEY=8sad4f9813f94sa9d4f
      - ASSET_SERVER_URL=http://host.docker.internal/web_asset_store.xml
      - ASSET_SERVER_KEY=KEY2THECITY
      - REPORT_RUNNER_HOST=report-runner
      - REPORT_RUNNER_PORT=8080
      - CELERY_BROKER_URL=redis://redis/0
      - CELERY_RESULT_BACKEND=redis://redis/1
      - LOG_LEVEL=WARNING
      - SP7_DEBUG=false

  specify7-worker:
    restart: unless-stopped
    image: specifyconsortium/specify7-service:v7
    command: ve/bin/celery -A specifyweb worker -l INFO --concurrency=1
    init: true
    volumes:
      - "specify6:/opt/Specify:ro"
      - "static-files:/volumes/static-files"
    environment:
      - DATABASE_HOST=mariadb
      - DATABASE_PORT=3306
      - DATABASE_NAME=specify
      - MASTER_NAME=master
      - MASTER_PASSWORD=master
      - SECRET_KEY=8sad4f9813f94sa9d4f
      - ASSET_SERVER_URL=http://host.docker.internal/web_asset_store.xml
      - ASSET_SERVER_KEY=KEY2THECITY
      - REPORT_RUNNER_HOST=report-runner
      - REPORT_RUNNER_PORT=8080
      - CELERY_BROKER_URL=redis://redis/0
      - CELERY_RESULT_BACKEND=redis://redis/1
      - LOG_LEVEL=WARNING
      - SP7_DEBUG=false

  asset-server:
    restart: unless-stopped
    image: specifyconsortium/specify-asset-service
    init: true
    volumes:
      - "attachments:/home/specify/attachments"
    environment:
      - SERVER_NAME=host.docker.internal
      - SERVER_PORT=80
      - ATTACHMENT_KEY=KEY2THECITY
      - DEBUG_MODE=false

  specify6:
    image: specifyconsortium/specify6-service:6.8.03
    volumes:
      - "specify6:/volumes/Specify"

  nginx:
    restart: unless-stopped
    image: nginx
    ports:
      - "80:80"
    volumes:
      - "static-files:/volumes/static-files:ro"
      - "specify6:/volumes/specify6:ro"

      - "./nginx/specify.conf:/etc/nginx/conf.d/default.conf:ro"

  report-runner:
    restart: unless-stopped
    image: specifyconsortium/report-runner

  redis:
    restart: unless-stopped
    image: redis:6.0

volumes:
  attachments: # the asset-servers attachment files
  database: # the data directory for maniadb
  specify6: # provides Specify 6 files to Specify 7 and the web server
  static-files: # provides Specify 7 static files to the web server

Great written instructions from the community: