导出PDF文件中文乱码的问题,需要宿主机安装中文字体
54
# 使用基础镜像
FROM autoscalix/bookstack:amd64-latest
# 将 deb 安装包拷贝到容器内
COPY ./wkhtmltox_0.12.6.1-2.bullseye_amd64.deb /tmp/
# 修改源为阿里源并安装依赖
RUN echo "deb http://mirrors.aliyun.com/debian/ bullseye main contrib non-free" > /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y wget fontconfig libfreetype6 xfonts-base xfonts-75dpi && \
dpkg -i /tmp/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb && \
apt-get install -f && \
cp /usr/local/bin/wkhtmltopdf /usr/bin/
# 清理安装包
RUN rm -f /tmp/wkhtmltox_0.12.6.1-2.bullseye_amd64.deb
# 定义镜像启动时执行的命令
CMD ["/docker-entrypoint.sh"]
# 创建数据库
mysql> CREATE DATABASE IF NOT EXISTS bookstackapp CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
# 创建用户
mysql> CREATE USER 'bookstack'@'%' IDENTIFIED BY 'bookstack';
# 授权
mysql> GRANT ALL PRIVILEGES ON bookstackapp.* TO 'bookstack'@'%';
# 刷新权限
mysql> FLUSH PRIVILEGES;
mysql>
version: "3.2"
services:
bookstack:
image: docker1001/bookstack-custom-cn:23.12
container_name: bookstack-custom-cn
environment:
- TZ=Asia/Shanghai
- APP_URL=http://10.0.10.85:6875
- DB_HOST=192.168.0.80
- DB_USERNAME=bookstack
- DB_PASSWORD=bookstack
- DB_DATABASE=bookstackapp
- DB_PORT=3306
- WAIT_DB_INIT=1
- WKHTMLTOPDF=/usr/bin/wkhtmltopdf
- ALLOW_UNTRUSTED_SERVER_FETCHING=true
volumes:
- ${PWD}/bookstack_app_data:/config
- /usr/share/fonts:/usr/share/fonts
ports:
- 6875:80
restart: unless-stopped
# 需要注意 : 将宿主机的字体映射到容器内部,故宿主机需要安装中文字体
docker-compose up -d
Content type
Image
Digest
sha256:b193a777f…
Size
362.3 MB
Last updated
over 2 years ago
docker pull docker1001/bookstack-custom-cn:23.12