SaeTable表格部署
概述
本章主要介绍在Linux系统centos7.9+宝塔+Docker进行部署SaeTable4.2.0,其中通过安装宝塔面板可以快速可视化部署SaeTable,对于有技术人员可以不用部署宝塔面板。
准备工作
一台X86或??主机安装centos7x(自行安装,不在详述)
安装宝塔面板(自行安装,不在详述)
安装Docker和docker-compose(自行安装,不在详述)
服务器配置要求
最低要求
2 核 4GB 内存
推荐配置
4 核 8GB 内存
开始部署
下载 SeaTable 镜像
拉取 SeaTable 镜像
docker pull seatable/seatable-developer:{tag}
注:{tag}为拉取镜像版本(4.2.0)
您可以在官方 docker仓库 中找到 SeaTable 开发者版的所有版本 。
下载 docker-compose.yml 和 .env 文件
官方默认在 /opt/seatable
中安装 SeaTable ,进入命令模式先创建目录 (如安装宝塔面板,直接在/opt/创建seatable文件夹)
mkdir /opt/seatable
将 docker-compose.yml 和 .env (文件名前包含 ‘.’)示例文件下载到 /opt/seatable
, 然后根据您的环境修改 .env 文件, 需要修改以下字段
SeaTable 的镜像标签(SEATABLE_IMAGE)
SeaTable 数据的卷目录(SEATABLE_VOLUMES)
MySQL 数据的卷目录(SEATABLE_MYSQL_VOLUMES)
MySQL 的 root 的密码(SEATABLE_MYSQL_ROOT_PASSWORD)
主机名(SEATABLE_SERVER_HOSTNAME),域名或者你的服务器的外部 IP
时区(TIME_ZONE 可选)
管理员账户邮箱(SEATABLE_ADMIN_EMAIL)
管理员账户密码(SEATABLE_ADMIN_PASSWORD)
编辑.env
示意格式如下:
COMPOSE_FILE='docker-compose.yml'
COMPOSE_PATH_SEPARATOR=','
#SeaTable 的镜像标签
SEATABLE_IMAGE=seatable/seatable-developer:latest
#SeaTable 数据的卷目录
SEATABLE_VOLUMES=/opt/seatable/seatable-data
MySQL 数据的卷目录
SEATABLE_MYSQL_VOLUMES=/opt/seatable/mysql-data
#MySQL的类型
SEATABLE_MYSQL_DB_HOST=mariadb
#MySQL的root的密码
SEATABLE_MYSQL_ROOT_PASSWORD=sxxxxxxx23
#时区
TIME_ZONE='Asia/Shanghai'
# 指定启用http(s)时的主机名
SEATABLE_SERVER_HOSTNAME=table.xxxx.cn
SEATABLE_SERVER_PROTOCOL=table.xxxx.cn
#是否使用加密证书,默认:False,启用:True
SEATABLE_SERVER_LETSENCRYPT=True
SEATABLE_SSL_PORT=8266
#管理员账户邮箱
SEATABLE_ADMIN_EMAIL=hxxx8@163.com
#管理员账户密码
SEATABLE_ADMIN_PASSWORD=sxxxxxxx23
编辑docker-compose.yml
示意格式如下:
services:
seatable-server:
image: ${SEATABLE_IMAGE:-seatable/seatable-developer:latest}
restart: unless-stopped
container_name: seatable
ports:
- 8166:80 #映射容器80端口到外网8166端口;
- ${SEATABLE_SSL_PORT:-8266}:443#SSL 443映射8266端口;
volumes:
- "${SEATABLE_VOLUMES:-/opt/seatable/seatable-data}:/shared"
environment:
- DB_HOST=${SEATABLE_MYSQL_DB_HOST:-mariadb}
- DB_ROOT_PASSWD=${SEATABLE_MYSQL_ROOT_PASSWORD:-sxxxxxxx23} #MSQL密码
- SEATABLE_SERVER_HOSTNAME=${SEATABLE_SERVER_HOSTNAME:-table.xxxx.cn} #指定启用http域名/IP
- SEATABLE_SERVER_PROTOCOL=${SEATABLE_SERVER_PROTOCOL:-table.xxxx.cn} #指定启用https域名/IP
- SEATABLE_SERVER_LETSENCRYPT=${SEATABLE_SERVER_LETSENCRYPT:-True} #默认值为 False。 是否使用加密证书True
- SEATABLE_ADMIN_EMAIL=${SEATABLE_ADMIN_EMAIL:-hfr818@163.com} #管理员邮箱账号
- SEATABLE_ADMIN_PASSWORD=${SEATABLE_ADMIN_PASSWORD:-sxxxxxxx23} #管理员登录密码,管理员账号密码在4.2.0版本设置无效,需要重置密码;
- TIME_ZONE=${TIME_ZONE:-Asia/Shanghai}
depends_on:
mariadb:
condition: service_healthy
memcached:
condition: service_started
redis:
condition: service_started
networks:
- frontend-net
- backend-seatable-net
mariadb:
image: ${SEATABLE_DB_IMAGE:-mariadb:10.11}
restart: unless-stopped
container_name: seatable-mysql
environment:
#MYQL数据库root密码
- MYSQL_ROOT_PASSWORD=${SEATABLE_MYSQL_ROOT_PASSWORD:-sxFrKj0723}
- MYSQL_LOG_CONSOLE=true
- MARIADB_MYSQL_LOCALHOST_USER=1
- MARIADB_MYSQL_LOCALHOST_GRANTS=USAGE
- MARIADB_AUTO_UPGRADE=1
volumes:
- "${SEATABLE_MYSQL_VOLUMES:-/opt/seatable/mysql-data}:/var/lib/mysql"
networks:
- backend-seatable-net
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-p${SEATABLE_MYSQL_ROOT_PASSWORD:-sxxxxxxx23}", "-h", "localhost"]
interval: 5s
timeout: 30s
retries: 60
memcached:
image: ${SEATABLE_MEMCACHED_IMAGE:-memcached:1.5.6}
restart: unless-stopped
container_name: seatable-memcached
entrypoint: memcached -m 256
networks:
- backend-seatable-net
redis:
image: ${SEATABLE_REDIS_IMAGE:-redis:5.0.7}
restart: unless-stopped
container_name: seatable-redis
networks:
- backend-seatable-net
networks:
frontend-net:
name: frontend-net
backend-seatable-net:
name: backend-seatable-net
启动 SeaTable 服务器
使用以下命令启动 SeaTable 服务器
#初始化数据库并启动SeaTable服务器
docker compose up -d
#启动 SeaTable 服务
docker exec -d seatable /shared/seatable/scripts/seatable.sh start
# 创建一个管理员帐户(可选)
docker exec -it seatable /shared/seatable/scripts/seatable.sh superuser
#邮箱账号
E-mail address: xxxx@xxxx.cn
#邮箱密码
Password:
#重复输入密码
Password (again):
#如下证明创建成功
Superuser created successfully.
注意:您应该在带有 docker-compose.yml
的目录中运行上述命令。
docker compose up -d
成功界面如下:
注意:修改
dtable_web_settings.py
和ccnet.conf文件,添加绝对访问端口,要不然可以进入系统,表格加载的时候显示 Network error
cd /opt/seatable/seatable-data/seatable/conf
vim dtable_web_settings.py
#为下面5处增加端口
#DTABLE_SERVER_URL = 'http://table.xxx.cn:8166/dtable-server/'
#DTABLE_SOCKET_URL = 'http://table.xxx.cn:8166/'
#DTABLE_WEB_SERVICE_URL = 'http://table.sxfrkj.cn:8166/'
#DTABLE_DB_URL = 'http://table.sxfrkj.cn:8166/dtable-db/'
#FILE_SERVER_ROOT = 'http://table.sxfrkj.cn:8166/seafhttp/'
vim ccnet.conf
#SERVICE_URL = http://table.xxx.cn:8166/
接下来,您可以通过网站访问 SeaTable。
评论区