Docker部署
当前Docker镜像支持开发模式dev和生产模式start。
开发模式内置了golang和nodejs环境;
生产模式提供了飞布运行所必须得环境;
构建镜像
您可以按照下述方法自行构建镜像,也可以使用Fireboom官方构建的镜像,前往 dockerhub查看 。
Dockerfile
下面是构建Fireboom镜像依赖的所有文件,详情前往仓库查看:https://github.com/lcRuri/fireboom-docker
fireboom-docker目录
Dockerfile
FROM golang:1.20-alpine
MAINTAINER lcRuri
RUN apk update && \
apk add --no-cache git bash curl
# 安装 Node.js
RUN apk add --no-cache nodejs npm
WORKDIR /dist
# 将host.sh脚本复制到容器中
COPY ./host.sh /dist
# 运行脚本
RUN chmod +x host.sh
# 指定挂载目录
VOLUME /dist/log
VOLUME /dist/store
VOLUME /dist/template
VOLUME /dist/upload
VOLUME /dist/custom-go
VOLUME /dist/custom-ts
VOLUME /dist/exported
EXPOSE 9123
EXPOSE 9991
ENTRYPOINT ["/dist/host.sh"]host.sh
#!/bin/bash
# 解决docker镜像IPV6的问题
echo "0.0.0.0 localhost">/etc/hosts
# 使用install.sh脚本安装Fireboom,并使用 init-todo 模板初始化
curl -fsSL fireboom.io/install.sh | bash -s fb-project -t fb-init-todo
start_command="/dist/fireboom $1"
eval "$start_command"
构建
在上述fireboom-docker目录下执行如下命令:
docker build -t fireboom_server:latest使用方法
1. 拉取镜像
2. 运行容器
以开发模式启动,不可用于正式环境!
若是windows系统,请将 $(pwd) 替换为**${pwd}**
以生产模式启动
挂载目录
容器的工作目录为:./fbserver,根据需求挂载下述子目录。
存储目录: store、upload、exported
钩子目录:custom-go 或 custom-ts (不用钩子,无需暴露)
日志目录(可选):log
端口说明
9123:飞布控制台的端口
9991:飞布处理所有api请求的端口
3. 使用Fireboom
最后更新于