Here is a simple example for Seafile hosted with Docker in a Compose stack.
For your database network I create it as an --internal network: docker network create --internal your-name-here
Note: Update your email address, volume locations, and password fields
services:
seafile-db:
image: mariadb:10.11
container_name: seafile-db
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_LOG_CONSOLE=true
- MARIADB_AUTO_UPGRADE=1
volumes:
- /mnt/storage/seafile/database:/var/lib/mysql
networks:
- seafile-db
memcached:
image: memcached:1.6.18
container_name: seafile-memcached
restart: unless-stopped
entrypoint: memcached -m 256
networks:
- seafile-net
- seafile-db
seafile:
image: seafileltd/seafile-mc:11.0-latest
container_name: seafile
restart: unless-stopped
ports:
# host port:container port
# The first host port is where the container listens (externally) : The container port is where it listens on the docker network / where other containers in that net can reach it on
# Say you have a proxy listening on port 80 for your host system, just put your container on 8081 for devices on your LAN, other containers will still reach it on 80
- "8081:80"
volumes:
- /mnt/storage/seafile/appdata:/shared
environment:
- DB_HOST=seafile-db
- DB_ROOT_PASSWD=password
- TIME_ZONE=Etc/UTC
- SEAFILE_ADMIN_EMAIL=your-email-here
- SEAFILE_ADMIN_PASSWORD=password
- SEAFILE_SERVER_LETSENCRYPT=false
depends_on:
- seafile-db
- memcached
networks:
- seafile-net
- seafile-db
networks:
seafile-net:
internal: false
seafile-db:
internal: true