docker-compose搭建seafile开源版私有云盘
1、linux下安装docker-ce方法自行百度2、下载docker-compose稳定的版本curl -L “https://github.com/docker/compose/releases/download/1.24.1/docker-compose-(uname−s)−(uname -s)-(uname−s)−(uname -m)” -o /usr/local/bin/docker-c
1、linux下安装docker-ce
方法自行百度
2、下载docker-compose稳定的版本
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
3、对下载的版本给予可执行权限
chmod +x /usr/local/bin/docker-compose
4、做软连接,为了让docker-compose可在全局执行
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
5、docker-compose版本检查
docker-compose --version
6、创建docker-compose.yml文件
vim docker-compose.yml
version: '2.0'
services:
db:
image: mariadb:10.1
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.5.6
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-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 use letsencrypt to generate cert.
- SEAFILE_SERVER_HOSTNAME=seafile.example.com # Specifies your host name.
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
文件目录映射到本地目录:
/opt/seafile-mysql/db
/opt/seafile-data
7、启动docker-compose直到完成
docker-compose up -d docker-compose.yml
8、访问页面
浏览器访问http://服务器IP (端口可在docker-compose.yml修改)
默认账号密码me@example.com asecret (可在docker-compose.yml修改)
9、修改服务器上传文件地址
登陆后点击右上角系统管理
设置中修改域名为服务器IP
之后即可正常使用
容器路径会映射在服务器/opt下
上传的文件会分片存储在如下路径
/opt/seafile-data/seafile/seafile-data/storage
参考官方文档
https://cloud.seafile.com/published/seafile-manual-cn/docker/
更多推荐
所有评论(0)