找回密码
 加入我们
搜索
      
查看: 1301|回复: 3

[软件] 主机内已有mysql如何在docker内安装seafile?

[复制链接]
发表于 2024-7-21 16:27 | 显示全部楼层 |阅读模式
本帖最后由 aikgogo 于 2024-7-21 16:28 编辑

debian服务器内已有子mysql,如何用docker安装?

官方的yml配置
  1. services:
  2.   db:
  3.     image: mariadb:10.11
  4.     container_name: seafile-mysql
  5.     environment:
  6.       - MYSQL_ROOT_PASSWORD=db_dev  # Required, set the root's password of MySQL service.
  7.       - MYSQL_LOG_CONSOLE=true
  8.       - MARIADB_AUTO_UPGRADE=1
  9.     volumes:
  10.       - /opt/seafile-mysql/db:/var/lib/mysql  # Required, specifies the path to MySQL data persistent store.
  11.     networks:
  12.       - seafile-net

  13.   memcached:
  14.     image: memcached:1.6.18
  15.     container_name: seafile-memcached
  16.     entrypoint: memcached -m 256
  17.     networks:
  18.       - seafile-net
  19.          
  20.   seafile:
  21.     image: seafileltd/seafile-mc:11.0-latest
  22.     container_name: seafile
  23.     ports:
  24.       - "80:80"
  25. #     - "443:443"  # If https is enabled, cancel the comment.
  26.     volumes:
  27.       - /opt/seafile-data:/shared   # Required, specifies the path to Seafile data persistent store.
  28.     environment:
  29.       - DB_HOST=db
  30.       - DB_ROOT_PASSWD=db_dev  # Required, the value should be root's password of MySQL service.
  31.       - TIME_ZONE=Etc/UTC  # Optional, default is UTC. Should be uncomment and set to your local time zone.
  32.       - SEAFILE_ADMIN_EMAIL=me@example.com # Specifies Seafile admin user, default is 'me@example.com'.
  33.       - SEAFILE_ADMIN_PASSWORD=asecret     # Specifies Seafile admin password, default is 'asecret'.
  34.       - SEAFILE_SERVER_LETSENCRYPT=false   # Whether to use https or not.
  35.       - SEAFILE_SERVER_HOSTNAME=docs.seafile.com # Specifies your host name if https is enabled.
  36.     depends_on:
  37.       - db
  38.       - memcached
  39.     networks:
  40.       - seafile-net

  41. networks:
  42.   seafile-net:
复制代码



我直接运行的命令

  1. docker run -itd \
  2.         --name seafile \
  3.     -v /usr/local/etc/docker/seafile/seafile-data:/shared/seafile/seafile-data \
  4.     -v /mnt/Public/sync:/shared \
  5.     -p 8083:80 \
  6.         -e DB_HOST=db \
  7.         -e DB_ROOT_PASSWD=mydql_db_password \
  8.         -e TIME_ZONE=Asia/Shanghai \
  9.         -e SEAFILE_ADMIN_EMAIL=gmail@gmail.com \
  10.         -e SEAFILE_ADMIN_PASSWORD=password \
  11.         -e SEAFILE_SERVER_LETSENCRYPT=false \
  12.         -e SEAFILE_SERVER_HOSTNAME=xxxx.com \
  13.     --restart=always \
  14.     seafileltd/seafile-mc:latest
复制代码


想问下,DB_HOST=db这个如何填写?mysql想直接使用主机的,求高手,谢谢!!!

附上官方的安装说明链接:
https://cloud.seafile.com/publis ... %E7%BD%B2Seafile.md
发表于 2024-7-21 16:36 | 显示全部楼层
要使用主机网络吧,--net=host
 楼主| 发表于 2024-7-21 16:37 | 显示全部楼层
本帖最后由 aikgogo 于 2024-7-21 16:39 编辑
霸天虎撤退 发表于 2024-7-21 16:36
要使用主机网络吧,--net=host


谢谢,连上了,忘了这个了。

但是使用host的网络,80端口也跑到主机里去了,有啥招?
发表于 2024-7-21 17:46 来自手机 | 显示全部楼层
docker --link
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

Archiver|手机版|小黑屋|Chiphell ( 沪ICP备12027953号-5 )沪公网备310112100042806 上海市互联网违法与不良信息举报中心

GMT+8, 2025-4-28 19:25 , Processed in 0.008686 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2007-2024 Chiphell.com All rights reserved.

快速回复 返回顶部 返回列表