docker下的环境部署合集

docker安装

一键安装脚本命令

1
curl -sSL https://get.daocloud.io/docker | sh

可视化面板安装

1
docker run --restart always --name fast -p 8081:8081 -d -v /var/run/docker.sock:/var/run/docker.sock wangbinxingkong/fast

nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
docker pull nginx:latest

# 拷贝配置文件到宿主机
docker run --name tmp-nginx-container -d nginx
mkdir -p /root/nginx/
docker cp tmp-nginx-container:/etc/nginx/nginx.conf /root/nginx/nginx.conf
docker cp -a tmp-nginx-container:/usr/share/nginx/html /root/nginx
docker cp -a tmp-nginx-container:/etc/nginx/conf.d /root/nginx/conf.d
# 删除临时容器
docker rm -f tmp-nginx-container

# 映射目录运行容器
docker run --name nignx -e TZ="Asia/Shanghai" -d -p 80:80 -v /root/nginx/html:/usr/share/nginx/html -v /root/nginx/nginx.conf:/etc/nginx/nginx.conf -v /root/nginx/conf.d:/etc/nginx/conf.d -v /root/nginx/logs:/var/log/nginx nginx

memcached安装

1
2
3
apt-get install memcached libmemcached-dev -y
pip3 install --timeout=3600 pylibmc django-pylibmc
systemctl enable --now memcached

mariadb安装

1
2
3
apt-get install mariadb-server
# 创建root账户
mysqladmin -uroot password '123456'
  • seafile解压
    1
    2
    3
    4
    5
    # 到指定目录创建seafile文件夹
    mkdir -p seafile/installed
    # 将下载的seafile-server-xxx.tar.gz复制到installed文件夹中进行解压
    tar -zxf seafile-server-9.0.2-bullseye-arm32v7l.tar.gz -C ../
    chmod -R 755 seafile-server-9.0.2/
    seafile目录结构如下:
    seafile
    ├── installed
    │ └── seafile-server-9.0.2-bullseye-arm32v7l.tar.gz
    └── seafile-server-9.0.2
    ├── setup-seafile-mysql.sh
    ├── ……
    然后执行安装脚本
    1
    2
    cd seafile/seafile-server-9.0.2
    ./setup-seafile-mysql.sh
    初始化安装步骤:
    1
    2
    3
    4
    5
    6
    7
    8
    -------------------------------------------------------
    Please choose a way to initialize seafile databases:
    -------------------------------------------------------

    [1] Create new ccnet/seafile/seahub databases
    [2] Use existing ccnet/seafile/seahub databases

    # 输入 1,然后根据提示依次提供相关信息即可