参考文章:https://augustdoit.men/seafile-docker/
docker-compose.yml文件:https://augustdoit.men/code/docker-compose.yml
version: '2.0'
services:
db:
image: mariadb:10.11
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=db_dev # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- /opt/seafile-mysql/db:/var/lib/mysql # Requested, 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
elasticsearch:
image: elasticsearch:8.6.2
container_name: seafile-elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
volumes:
- /opt/seafile-elasticsearch/data:/usr/share/elasticsearch/data # Requested, specifies the path to Elasticsearch data persistent store.
networks:
- seafile-net
seafile:
image: docker.seafile.top/seafileltd/seafile-pro-mc:latest
container_name: seafile
ports:
- "80:80"
# - "443:443" # If https is enabled, cancel the comment.
volumes:
- /opt/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=db_dev # Requested, the value shuold be root's password of MySQL service.
# - TIME_ZONE=Asia/Shanghai # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=me@example.com # Specifies Seafile admin user, default is 'me@example.com'
- SEAFILE_ADMIN_PASSWORD=asecret # Specifies Seafile admin password, default is 'asecret'
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not
- SEAFILE_SERVER_HOSTNAME=seafile.example.com # Specifies your host name if https is enabled
depends_on:
- db
- memcached
- elasticsearch
networks:
- seafile-net
networks:
seafile-net:
# 按配置文件手动创建映射路径
mkdir -p /home/seafile-elasticsearch/data # 注意目录配置文件默认是/opt,我的改成了/home
# 赋予权限
chmod 777 -R /home/seafile-elasticsearch/data # 同样注意目录
# 进入家目录
cd /home
# 下载配置文件
wget https://augustdoit.men/code/docker-compose.yml
# 编辑配置文件
vim docker-compose.yml
# 以下字段可以修改
第7行 - MYSQL_ROOT_PASSWORD= admin # root 密码用于MySQL service
第10行 - /home/seafile-mysql/db:/var/lib/mysql # 数据库存储映射目录,可不更改
第30行 - /home/seafile-elasticsearch/data:/usr/share/elasticsearch/data #搜索服务映射目录目录,可不更改
第39行 # - "443:443" # 是否开启https 443端口 ,要开启把前面的#删掉即可
第41行 - /home/seafile-data:/shared # 数据存储映射目录,可以不更改
第44行 - DB_ROOT_PASSWD= admin # 数据库root用户密码
第45行 - TIME_ZONE=Asia/Shanghai # 时区
第46行 - SEAFILE_ADMIN_EMAIL= augustdoit@gmail.com # seafile 管理员邮箱
第47行 - SEAFILE_ADMIN_PASSWORD= admin # seafile 管理员密码
第48行 - SEAFILE_SERVER_LETSENCRYPT=false #是否使用LET'S申请证书
第49行 - SEAFILE_SERVER_HOSTNAME=xxx.com # 填写域名
通过nps做穿透。

评论区