Browsed by
Month: June 2021

DirectAdmin + Seafile Configuration

DirectAdmin + Seafile Configuration

After a lot of trial and error, I have finally managed to get Seafile working with my DirectAdmin panel. I am posting my configuration here so that it will be much easier to do the next time!

First, here is my docker-compose.yml file:

version: '2.0'
services:
  db:
    image: mariadb:10.5
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=PASSWORD  # Requested, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
    volumes:
      - /app/seafile/seafile-mysql/db:/var/lib/mysql  # Requested, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.5.6
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net

  elasticsearch:
    image: seafileltd/elasticsearch-with-ik:5.6.16
    container_name: seafile-elasticsearch
    environment:
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms1g -Xmx1g"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 2g
    volumes:
      - /app/seafile/seafile-elasticsearch/data:/usr/share/elasticsearch/data  # Requested, specifies the path to Elasticsearch data persistent store.
    networks:
      - seafile-net

  seafile:
    image: docker.seadrive.org/seafileltd/seafile-pro-mc:latest
    container_name: seafile
    ports:
      - "8082:80"
      - "8443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /app/seafile/seafile-data:/shared   # Requested, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=db
      - DB_ROOT_PASSWD=PASSWORD  # Requested, the value should be root's password of MySQL service.
      - TIME_ZONE=America/Chicago # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL=EMAIL # Specifies Seafile admin user, default is 'me@example.com'
      - SEAFILE_ADMIN_PASSWORD=PASSWORD     # Specifies Seafile admin password, default is 'asecret'
      - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not
      - SEAFILE_SERVER_HOSTNAME=HOSTNAME # Specifies your host name if https is enabled
    depends_on:
      - db
      - memcached
      - elasticsearch
    networks:
      - seafile-net

networks:
  seafile-net:

And now, here is the DirectAdmin Reverse Proxy code that should be pasted in to the Custom HTTPD section:

|*if SUB="seafile"|
SSLProxyEngine On
ProxyPreserveHost On

ProxyPass / https://seafile.EXAMPLE.COM:8443/
ProxyPassReverse / https://seafile.EXAMPLE.COM:8443/

|*endif|