compose文件
version: '2.0'
services:
db:
image: mariadb:10.1
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=root # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- /root/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
seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
ports:
- "50501:80"
# - "443:443" # If https is enabled, cancel the comment.
volumes:
- /root/seafile/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=root # 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=suveng@163.com # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=admin # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=192.168.9.233:50501 # Specifies your host name if https is enabled.
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
启动
#安装docker-compse
yum install docker-compose -y
#在compose文件所在的目录下
docker-compose up -d
查看
docker ps
应该会看到names
为 seafile
seafile-mysql
seafile-memcached
三个容器已经启动
如果没有看到,那么可能检查一下配置文件,看看mysqldata的路径和seafile data的路径是否存在,如果不存在,可以先创建.
提示: 建议找一个比较大的磁盘空的目录存放.毕竟是云盘.
先使用管理员账号登录上去
默认管理员账号在docker-compose.yml的配置文件上, SEAFILE_ADMIN_EMAIL=suveng@163.com,SEAFILE_ADMIN_PASSWORD=admin
登录上去即可,当然你也可以在搭建的时候改掉配置.
原文:https://www.cnblogs.com/suveng/p/11525856.html