Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d908e226
authored
Sep 14, 2026
by
ccran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update Dockerfile and publish scripts.
parent
522456c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
3 deletions
+72
-3
Dockerfile
+5
-3
bin/docker-upload-ubuntu.sh
+67
-0
token模型需求表-0831-合并阶梯计费.xlsx
+0
-0
No files found.
Dockerfile
View file @
d908e226
FROM
docker.m.daocloud.io/oven/bun:1.4.0@sha256:5ff609364c049b54eb0ff560ec96319729a972078ef2c755d758f0c6ef89c2d6 AS builder
# Frontend output is platform-independent; run Bun on the build host architecture.
FROM
--platform=$BUILDPLATFORM docker.m.daocloud.io/oven/bun:1.4.0@sha256:5ff609364c049b54eb0ff560ec96319729a972078ef2c755d758f0c6ef89c2d6 AS builder
WORKDIR
/build/web
WORKDIR
/build/web
COPY
web/package.json web/bun.lock ./
COPY
web/package.json web/bun.lock web/.npmrc ./
RUN
bun install
--frozen-lockfile
# Limit simultaneous downloads for more reliable installs through network proxies.
RUN
bun install
--frozen-lockfile
--network-concurrency
4
COPY
./web ./
COPY
./web ./
COPY
./VERSION /build/VERSION
COPY
./VERSION /build/VERSION
RUN
DISABLE_ESLINT_PLUGIN
=
'true'
VITE_REACT_APP_VERSION
=
$(
cat
/build/VERSION
)
bun run build
RUN
DISABLE_ESLINT_PLUGIN
=
'true'
VITE_REACT_APP_VERSION
=
$(
cat
/build/VERSION
)
bun run build
...
...
bin/docker-upload-ubuntu.sh
0 → 100755
View file @
d908e226
#!/bin/bash
# 在 Mac(包括 Apple Silicon)上构建目标架构镜像,上传到 Ubuntu 并导入。
# 用法:bash bin/docker-upload-ubuntu.sh [user@host]
# 示例:SSH_PORT=22 IMAGE_TAG=new-api:export bash bin/docker-upload-ubuntu.sh
# SSH 使用本机 ~/.ssh/config、密钥或交互式密码认证。
set
-euo
pipefail
if
[[
"
${
1
:-}
"
==
"--help"
||
"
${
1
:-}
"
==
"-h"
]]
;
then
sed
-n
'2,5p'
"
$0
"
exit
0
fi
if
((
$#
>
1
))
;
then
echo
"用法:bash
$0
[user@host]"
>
&2
exit
1
fi
remote_host
=
${
1
:-
root
@8.136.9.68
}
ssh_port
=
${
SSH_PORT
:-
22
}
image_tag
=
${
IMAGE_TAG
:-
new
-api
:export
}
project_dir
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/.."
&&
pwd
)
if
[[
"
$remote_host
"
==
-
*
||
"
$remote_host
"
==
*
[[
:space:]]
*
||
-z
"
$remote_host
"
]]
;
then
echo
"无效的 SSH 目标:
$remote_host
"
>
&2
exit
1
fi
if
[[
!
"
$ssh_port
"
=
~ ^[0-9]+
$
]]
;
then
echo
"SSH_PORT 必须是端口号。"
>
&2
exit
1
fi
for
command_name
in
docker ssh scp
;
do
command
-v
"
$command_name
"
>
/dev/null
||
{
echo
"缺少命令:
$command_name
"
>
&2
exit
1
}
done
docker info
>
/dev/null
docker buildx version
>
/dev/null
echo
"检查 Ubuntu 架构及 Docker 权限:
$remote_host
"
remote_arch
=
$(
ssh
-p
"
$ssh_port
"
"
$remote_host
"
'set -e; docker info >/dev/null; uname -m'
)
case
"
$remote_arch
"
in
x86_64
)
platform
=
linux/amd64
;;
aarch64|arm64
)
platform
=
linux/arm64
;;
*
)
echo
"不支持的远端架构:
$remote_arch
"
>
&2
;
exit
1
;;
esac
# 临时文件放在构建上下文之外,避免将导出的镜像再次打包进镜像。
export_dir
=
$(
mktemp
-d
"
${
TMPDIR
:-
/tmp
}
/new-api-export.XXXXXX"
)
trap
'rm -rf -- "$export_dir"'
EXIT
archive_path
=
"
$export_dir
/new-api-export.tar"
echo
"构建
${
image_tag
}
,目标平台:
${
platform
}
(跨架构构建可能较慢)"
docker buildx build
--platform
"
$platform
"
--load
\
--tag
"
$image_tag
"
--file
"
$project_dir
/Dockerfile"
"
$project_dir
"
echo
"导出镜像"
docker save
-o
"
$archive_path
"
"
$image_tag
"
echo
"上传至
$remote_host
:~/new-api-export.tar"
scp
-P
"
$ssh_port
"
"
$archive_path
"
"
$remote_host
:new-api-export.tar"
echo
"在 Ubuntu 导入镜像"
ssh
-p
"
$ssh_port
"
"
$remote_host
"
'docker load -i "$HOME/new-api-export.tar"'
echo
"完成:远端已导入
${
image_tag
}
(
${
platform
}
)。"
echo
"远端归档保留在 ~/new-api-export.tar;本地临时归档会自动删除。"
echo
"现有容器不会自动重启,请在确认部署配置后重新创建容器。"
token模型需求表-0831-合并阶梯计费.xlsx
View file @
d908e226
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment