dev
parent
1e3f760be6
commit
80de9f4a9c
|
@ -1,8 +1,8 @@
|
||||||
FROM centos:7
|
FROM centos:7
|
||||||
USER root
|
USER root
|
||||||
ENV TZ=Asia/Shanghai
|
ENV TZ=Asia/Shanghai
|
||||||
COPY aiweek /usr/local/bin/ \
|
COPY aiweek /usr/local/bin/
|
||||||
./option/option.yaml /conf/
|
COPY ./option/option.yaml /conf/
|
||||||
RUN chmod +x /usr/local/bin/aiweek && mkdir /data /conf
|
RUN chmod +x /usr/local/bin/aiweek && mkdir /data /conf
|
||||||
ENTRYPOINT ["aiweek"]
|
ENTRYPOINT ["aiweek"]
|
||||||
CMD ["--livemode=false"]
|
CMD ["--livemode=false"]
|
|
@ -1,40 +1,8 @@
|
||||||
#!/usr/bin/bash
|
#!/usr/bin/bash
|
||||||
#不包含创建kimi逆向api,创建kimiapi需要访问https://github.com/LLM-Red-Team/kimi-free-api
|
#不包含创建kimi逆向api,创建kimiapi需要访问https://github.com/LLM-Red-Team/kimi-free-api
|
||||||
#docker部署一节,并修改配置文件。
|
#docker部署一节,并修改配置文件。
|
||||||
# 创建gopath目录
|
|
||||||
mkdir /root/go
|
|
||||||
cd /root/go
|
|
||||||
|
|
||||||
# 获取go安装包(如果下载不了,可以直接去浏览器下载,然后上传到linux)
|
|
||||||
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
|
|
||||||
|
|
||||||
# 解压并加入/usr/local目录
|
|
||||||
tar -C /usr/local -zxf go1.22.1.linux-amd64.tar.gz
|
|
||||||
|
|
||||||
# 导出go环境变量
|
|
||||||
PROFILE_CONTENT="
|
|
||||||
export GOROOT=/usr/local/go
|
|
||||||
export GOPATH=/root/go
|
|
||||||
export GOPROXY=https://goproxy.cn,direct
|
|
||||||
export PATH=\$PATH:$GOROOT/bin:$GOPATH/bin
|
|
||||||
"
|
|
||||||
|
|
||||||
# 检查 /etc/profile 文件是否存在
|
|
||||||
if [ -f /etc/profile ]; then
|
|
||||||
# 使用 echo 命令和 >> 操作符追加内容到 /etc/profile 文件末尾
|
|
||||||
echo "$PROFILE_CONTENT" >> /etc/profile
|
|
||||||
echo "已成功添加配置到 /etc/profile。"
|
|
||||||
else
|
|
||||||
echo "/etc/profile 文件不存在。"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 刷新环境变量
|
|
||||||
source /etc/profile
|
|
||||||
|
|
||||||
# 查看go版本,检查是否安装成功
|
|
||||||
go version
|
|
||||||
#编译
|
#编译
|
||||||
cd cmd && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../aiweek && cd ..
|
cd ./cmd && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../aiweek && cd ..
|
||||||
timestamp=$(date +%s)
|
timestamp=$(date +%s)
|
||||||
#docker构建
|
#docker构建
|
||||||
docker build -t aiweek:$timestamp .
|
docker build -t aiweek:$timestamp .
|
||||||
|
|
Loading…
Reference in New Issue