Seafile Refuses to Work With Separate Nginx Docker Container

I’ve been sifting through many reddit, github, and other posts on this forum and have found very conflicting information on how to actually make Seafile play nice when getting and SSL cert with NPM. I’ve checked the official documentation pages and none of them seem to address running one Seafile container and a separate NPM container, only when the two are together.

The goal is to get Seafile to run through NPM using http and is only sent through https once it leaves NPM. I’ve tried many variations of custom .conf workings for NPM, but none of them have worked and only returned “failed”. Again, all other posts online only detail how to correct the issue when Seafile and NPM are in one container, not running separate containers.

Here’s what I’ve done:

  • Checked the ports, nothing overlaps
  • Domain is up and working as it should
  • Changed SERVICE_URL and FILE_SERVER_ROOT to test.domain.com and test.domain.com/seafhttp (including http and https)
  • Made sure NPM and issue certs for other services

My compose file for Seafile is as follows:

services:
  db:
    image: mariadb:10.11
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=redacted  # Required, set the root's password of MySQL service.
      - MYSQL_LOG_CONSOLE=true
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - /opt/seafile-mysql/db:/var/lib/mysql  # Required, specifies the path to MySQL data persistent store.
    networks:
      - seafile-net

  memcached:
    image: memcached:1.6.18
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    networks:
      - seafile-net
          
  seafile:
    image: seafileltd/seafile-mc:10.0-latest
    container_name: seafile
    ports:
      - "82:80"
      #- "444:443"  # If https is enabled, cancel the comment.
    volumes:
      - /opt/seafile-data:/shared   # Required, specifies the path to Seafile data persistent store.
    environment:
      - DB_HOST=redacted
      - DB_ROOT_PASSWD=redacted  # Required, the value should be root's password of MySQL service.
      - TIME_ZONE=redacted  # Optional, default is UTC. Should be uncomment and set to your local time zone.
      - SEAFILE_ADMIN_EMAIL=redacted# Specifies Seafile admin user, default is 'me@example.com'.
      - SEAFILE_ADMIN_PASSWORD=redacted     # Specifies Seafile admin password, default is 'asecret'.
      #- SEAFILE_SERVER_LETSENCRYPT=true   # Whether to use https or not.
      - SEAFILE_SERVER_HOSTNAME=test.domain.com # Specifies your host name if https is enabled.
    depends_on:
      - db
      - memcached
    networks:
      - seafile-net

networks:
  seafile-net: